-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config.schema.json not valid #9749
Comments
@thscott thanks for reporting! |
Hey @Urigo , I have this same issue. Here is the contents of my codegen.yml schema: './schema.graphql'
generates:
./src/__generated__/resolvers-types.ts:
plugins:
- 'typescript'
- 'typescript-resolvers'
config:
useIndexSignature: true
contextType: '../index#MyContext' package json: {
"name": "graphql-server-example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"generate": "graphql-codegen --config codegen.yml",
"compile": "npm run generate && tsc",
"postinstall": "npm run compile",
"start": "npm run compile && node ./dist/index.js",
"watch": "concurrently --names \"CodeGen,TS,Nodemon\" -c \"bgYellow,bgBlue,bgMagenta\" \"graphql-codegen --watch 'src/**/*.ts'\" \"tsc -w \" \"nodemon ./dist/index.js \""
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@apollo/server": "^4.9.5",
"graphql": "^16.8.1"
},
"devDependencies": {
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-resolvers": "^4.0.1",
"@types/node": "^20.10.0",
"concurrently": "^8.2.2",
"nodemon": "^3.0.1",
"typescript": "^5.3.2"
}
} |
@bradskuse can you share a repo or a codesandbox with the whole code? |
With only the YAML extension installed, this is what I see: This extensions gets its schemas from a catalogue, for which the default is https://www.schemastore.org/api/json/catalog.json. This in turn points to https://the-guild.dev/graphql/codegen/config.schema.json, which contains (the seemingly invalid) FlutterFreezedPluginConfig properties. |
I'm having the same issue. |
This seems to have been introduced in dotansimha/graphql-code-generator-community#47 |
All properties of the The configuration types are "better" explained in the current documentation https://the-guild.dev/graphql/codegen/plugins/dart/flutter-freezed (or just https://github.com/dotansimha/graphql-code-generator-community/blob/b6c4b0159c53530251dc50040eeac282f6e128e9/packages/plugins/dart/flutter-freezed/src/config/plugin-config.ts). However, they feel "weird" and out of place compared to all other plugins. The schema has to be updated to reflect the more complex types. For example, for "FlutterFreezedPluginConfig": {
"description": "configure the `flutter-freezed` plugin",
"type": "object",
"properties": {
"camelCasedEnums": {
"anyOf": [{"type": "boolean"}, {"type": "string", "enum": ["snake_case", "camelCase", "PascalCase"]}],
"description": "Setting this option to `true` will camelCase enum values as required by Dart's recommended linter.\n\nIf set to false, the original casing as specified in the Graphql Schema is used\n\nYou can also transform the casing by specifying your preferred casing for Enum values.\n\nAvailable options are: `'snake_case'`, `'camelCase'` and `'PascalCase'`\n\nFor consistency, this option applies the same configuration to all Enum Types in the GraphQL Schema\nDefault value: \"true\""
}, That said, I am not sure who "owns" the schema nor how to manage the schema + docs complex types. Until this is fixed the schema is literally unusable, so perhaps yanking the |
+++ I'm seeing the same issue |
The json schema config.schema.json seems to be invalid, so is causing issues in vscode (which tries to validate the codegen.yml file).
This seems to be due to the property types of the FlutterFreezedPluginConfig being invalid, such as:
graphql-code-generator/website/public/config.schema.json
Line 111 in 527da03
The text was updated successfully, but these errors were encountered: