Hey there! I am running into a major issue when using Codegen with the Shopify Admin API. This seems to be a new error and potentially a bug in the API schema on the Shopify end of things..
I am getting this error when running Codegen:
> graphql-codegen --config codegen.ts
[dotenv@17.2.2] injecting env (12) from .env -- tip: ⚙️ suppress all logs with { quiet: true }
✔ Parse Configuration
⚠ Generate outputs
❯ Generate to ./types/shopify-admin.d.ts
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ Input Object type DeliverySettingInput must define one or more fields.
✔ Generate to ./types/shopify-storefront.d.ts
✖ One or more errors occurred, no files were generated. To allow output on errors, set config.allowPartialOutputs=true
ELIFECYCLE Command failed with exit code 1.
The issue lies in this field DeliverySettingInput. However, I never even use this field anywhere in my GraphQL at all:
import { gql } from 'graphql-tag'
export const CUSTOMER_UPDATE_METAFIELDS = gql`
mutation customerUpdate(
$input: CustomerInput!
) {
customerUpdate(input: $input) {
customer {
id
metafields(first: 10) {
edges {
node {
id
key
namespace
value
}
}
}
}
userErrors {
message
field
}
}
}
`
My Codegen config and Admin API GraphQL schemas have not changed all year and this is the first time I’m seeing this issue. Any information would be great!
Funny to see you here @rylanharper! Just came in to say, Nuxt Shopify is experiencing the same problem: Input Object type DeliverySettingInput must define one or more fields.
Then, no introspection loading anymore at all. No code changes, it just suddenly started failing
The fix has been deployed now. You should find that introspection is now working properly without any of the workarounds. I’m sorry for all the trouble we caused here.