You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am running into and issue when combining multiple sources together. The error I'm receiving is
- GraphQLError: Cannot read properties of undefined (reading 'myQuery')
After a bit of debugging, what I've noticed it that one of my sources has the root type of QueryType, while the others have Query.
Source A:
Source B:
Digging through the runtime code a bit what I've found is that info.parentType.name is always set to Query after merging the sources. For Source A, the context[apiName] object contains the key QueryType not Query, causing the error I've outlined above.
Is there a way for me to modify the schema / types of Source A after introspection, or have control over the info.parentType.name field? I've tried the rename transform plugin, but it doesn't seem to allow me to change the root types.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I am running into and issue when combining multiple sources together. The error I'm receiving is
- GraphQLError: Cannot read properties of undefined (reading 'myQuery')
After a bit of debugging, what I've noticed it that one of my sources has the root type of
QueryType
, while the others haveQuery
.Digging through the runtime code a bit what I've found is that
info.parentType.name
is always set toQuery
after merging the sources. For Source A, thecontext[apiName]
object contains the keyQueryType
notQuery
, causing the error I've outlined above.https://github.com/Urigo/graphql-mesh/blob/853f515aabef0d09c2233663f52bee1456adb09e/packages/runtime/src/get-mesh.ts#L99-L105
Is there a way for me to modify the schema / types of
Source A
after introspection, or have control over theinfo.parentType.name
field? I've tried the rename transform plugin, but it doesn't seem to allow me to change the root types.Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions