Which packages are impacted by your issue?
No response
Describe the bug
When using near-operation-file preset, codegen crashes with t his error: Unable to find field "__type" on type "Query"!
This is an example document:
query Test {
__type(name: "Role") {
enumValues(includeDeprecated: true) {
name
isDeprecated
}
}
}
Your Example Website or App
https://codesandbox.io/p/devbox/elastic-danilo-wg2p2q?workspaceId=ws_3d3S1CmTc7BCJtbnRB7BQC
Steps to Reproduce the Bug or Issue
- go to : https://codesandbox.io/p/devbox/elastic-danilo-wg2p2q?workspaceId=ws_3d3S1CmTc7BCJtbnRB7BQC
- open the terminal.
Expected behavior
Introspection queries are being generated properly when not using this preset. it should work using the preset as well..
Screenshots or Videos
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- NodeJS: [e.g. 18.5.0]
graphql version: [e.g. 16.3.0]
@graphql-codegen/* version(s): [e.g. 2.6.2]
Codegen Config File
import { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
schema: "schema.graphql",
documents: "document.graphql",
generates: {
"types.ts": { plugins: ["typescript"] },
"./": {
preset: "near-operation-file",
presetConfig: {
// This should be the file generated by the "typescript" plugin above,
// relative to the directory specified for this configuration
baseTypesPath: "./types.ts",
folder: "@generated",
},
// Exclude the generated files, so we don't get duplications
plugins: ["typescript-operations"],
},
},
};
export default config;
Additional context
No response
Which packages are impacted by your issue?
No response
Describe the bug
When using
near-operation-filepreset, codegen crashes with t his error:Unable to find field "__type" on type "Query"!This is an example document:
Your Example Website or App
https://codesandbox.io/p/devbox/elastic-danilo-wg2p2q?workspaceId=ws_3d3S1CmTc7BCJtbnRB7BQC
Steps to Reproduce the Bug or Issue
Expected behavior
Introspection queries are being generated properly when not using this preset. it should work using the preset as well..
Screenshots or Videos
No response
Platform
graphqlversion: [e.g. 16.3.0]@graphql-codegen/*version(s): [e.g. 2.6.2]Codegen Config File
Additional context
No response