Issue generating GQL types: type MetafieldAccessGrantOperationInput must define one or more fields

Hey there,

Recently our CI builds have started failing during graphql-codegen. Our app is based on the Remix template provided by Shopify:

> graphql-codegen -p admin

✔ Parse Configuration
⚠ Generate outputs
  ❯ Generate to ./app/types/admin-2024-07.schema.json
    ✔ Load GraphQL schemas
    ✔ Load GraphQL documents
    ✖ Input Object type MetafieldAccessGrantOperationInput must define one or more fields.
  ❯ Generate to ./app/types/admin.types.ts
    ✔ Load GraphQL schemas
    ✔ Load GraphQL documents
    ✖ Input Object type MetafieldAccessGrantOperationInput must define one or more fields.
  ✔ Generate to ./app/types/admin.generated.ts

Is anyone else experiencing this? It seems like something was deployed that’s broken the schema types.

Any help much appreciated!

Also happening on any query in the GraphiQL Shopify app.

I’m also experiencing this issue :downcast_face_with_sweat:

We’re experiencing the same issue with our builds. A recent deployment has introduced a broken schema, specifically with the MetafieldAccessGrantOperationInput type. Looks like we’re not the only ones affected!

Can confirm that this is a widespread error. It also affects the official GraphiQL interface for Shopify: the above error message shows up when the query result pane initially loads, and the schema documentation is missing from the left sidebar

A temporary fix is to disable the validation that happens while generating the types, using the skipDocumentsValidation option in the codegen config (reference)

Where exactly in the config can this be set? The graphql docs seem to use a different type than Shopify in the remix template.

for (const entry of extensions) {
const extensionPath = `./extensions/${entry}`;
const schema = `${extensionPath}/schema.graphql`;
if (!fs.existsSync(schema)) {
continue;
}
config.projects[entry] = {
schema,
documents: [`${extensionPath}/**/*.graphql`],
//DOESN'T WORK HERE
};
}

I’m not using the remix template, but I would try adding config: { skipDocumentsValidation: true } where your comment is