We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I get an error from Hive Usage collection with Yoga when a JSON scalar type is used within a GraphQL query / mutation.
With this query:
query MyAwesomeQuery { test( json: {hello: "world"} ) { id } }
I see error:
Failed to collect operation (name: "MyAwesomeQuery") TypeError: Cannot read properties of undefined (reading 'name') at resolveTypeName (node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-hive/client/cjs/internal/usage.js:421:46) at collectNode (node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-hive/client/cjs/internal/usage.js:257:35) at Object.ObjectField (node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-hive/client/cjs/internal/usage.js:391:17) at Object.enter (node_modules/.pnpm/[email protected]/node_modules/graphql/utilities/TypeInfo.js:391:27) at visit (node_modules/.pnpm/[email protected]/node_modules/graphql/language/visitor.js:197:21) at collect (node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-hive/client/cjs/internal/usage.js:324:23) at <anonymous> (node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-hive/client/cjs/internal/utils.js:31:23) at Object.complete (node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-hive/client/cjs/internal/usage.js:153:54) at onResultProcess (node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-hive/client/cjs/yoga.js:98:24) at processResult (node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-yoga/cjs/process-request.js:10:15)
The error doesn't occur when the JSON scalar is passed as a variable e.g.
query MyAwesomeQueryWithVariable($json: JSON) { test( json: $json ) { id } } Variables ======= { "json": {"hello": "world"} }
Versions
@graphql-hive/client: 0.32.0 graphql-yoga: 5.3.0
Possible Fix I dont know the full implications of doing this but the error can be fixed by adding a check to the collectNode() function in usage.ts:
collectNode()
usage.ts
if (!inputType) { return }
Thanks for the amazing project 🙏
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I get an error from Hive Usage collection with Yoga when a JSON scalar type is used within a GraphQL query / mutation.
With this query:
I see error:
The error doesn't occur when the JSON scalar is passed as a variable e.g.
Versions
Possible Fix
I dont know the full implications of doing this but the error can be fixed by adding a check to the
collectNode()
function inusage.ts
:Thanks for the amazing project 🙏
The text was updated successfully, but these errors were encountered: