-
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 |
Hello everyone, I am Parables, the author of the flutter-freezed plugin. TL'DR: I will fix this ASAP First of all, my sincere apologies for any inconveniences caused by this plugin.
I felt heart-broken when I read this because at the time I pushed that PR, I was going through some pretty rough times: financial crisis and in order to address that, I was working on multiple gigs, working 24/7, which resulted in my girlfriend leaving me because I didn't have time for her, leading to an emotional breakdown. Someway, somehow, I managed to overcome those issues and preventing a mental breakdown. Still not solved the financial issue, as I am barely employable with my diploma certificate in Computer Science despite the fact that I have over 9 years experience with software development from backend to frontend. Most opportunities are looking for BSc or HND holders. Still open for work, so please reach out if you can help. Currently a teacher in a primary school in a rural area in Ghana earning just a little to keep me from begging people for money while spending close to 85% of that income on building https://schoolman.app (hoping to launch it within Q1 of 2025) .... Sorry, I was getting very emotional on that... Please expect a fix within the upcoming weeks. Thanks very much for your patience... |
dotansimha/graphql-code-generator-community#892 This should fix it, please let me know if the issue still persists as I am unable to set up a complete dev environment to test it. For future issues, please tag me @Parables for me to get notified about this plugin. Thanks once again. |
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: