-
Notifications
You must be signed in to change notification settings - Fork 11
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
The type __Schema
is not an object in the defined schema, but the GraphQL document is traversing it.
#345
Comments
Hey @danbeneventano thanks for the report! We added a fix for #269 here - urql-graphql/urql#893 As for why you're seeing a similar issue, I suspect it's related to your schema using the |
I'm having the same issue. Definitely seems to be due to the introspection query that Had a look at the fix in urql-graphql/urql#893 but I don't see this logic in the latest version of the schemaPredicates.ts. Perhaps this is a regression? |
Ah I see the logic changed to use a regex that should match any fieldName beginning with For reference, here's the complete error I'm seeing:
|
After some more digging I am fairly confident the error is happening because the query used to generate the schema that Specifically, the I'm generating the schema for I've opened a ticket for graphql-codegen with full details here: dotansimha/graphql-code-generator#5981 However maybe it's possible for the GraphCache exchange to handle this specific situation better? Here's where the error is coming from: https://github.com/FormidableLabs/urql/blob/4c1a9d9bd3df55207aeff1ffc3e2b3262f27cbc9/exchanges/graphcache/src/ast/schemaPredicates.ts#L70 Here are the two introspection queries and their diff: ########################################
# graphql-codegen introspection query:
########################################
query IntrospectionQuery {
__schema {
queryType {
name
}
mutationType {
name
}
subscriptionType {
name
}
types {
...FullType
}
directives {
name
description
locations
args {
...InputValue
}
}
}
}
fragment FullType on __Type {
kind
name
description
fields(includeDeprecated: true) {
name
description
args {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields {
...InputValue
}
interfaces {
...TypeRef
}
enumValues(includeDeprecated: true) {
name
description
isDeprecated
deprecationReason
}
possibleTypes {
...TypeRef
}
}
fragment InputValue on __InputValue {
name
description
type {
...TypeRef
}
defaultValue
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
}
########################################
# urql-devtools introspection query:
########################################
query IntrospectionQuery {
__schema {
queryType {
name
__typename
}
mutationType {
name
__typename
}
subscriptionType {
name
__typename
}
types {
...FullType
__typename
}
directives {
name
description
locations
args {
...InputValue
__typename
}
__typename
}
__typename
}
}
fragment FullType on __Type {
kind
name
description
fields(includeDeprecated: true) {
name
description
args {
...InputValue
__typename
}
type {
...TypeRef
__typename
}
isDeprecated
deprecationReason
__typename
}
inputFields {
...InputValue
__typename
}
interfaces {
...TypeRef
__typename
}
enumValues(includeDeprecated: true) {
name
description
isDeprecated
deprecationReason
__typename
}
possibleTypes {
...TypeRef
__typename
}
}
fragment InputValue on __InputValue {
name
description
type {
...TypeRef
__typename
}
defaultValue
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
__typename
}
__typename
}
__typename
}
__typename
}
__typename
}
__typename
}
__typename
}
} Here is the diff between the two queries: 5d4
< __typename
9d7
< __typename
13d10
< __typename
17d13
< __typename
25d20
< __typename
27d21
< __typename
29d22
< __typename
42d34
< __typename
46d37
< __typename
50d40
< __typename
54d43
< __typename
58d46
< __typename
65d52
< __typename
69d55
< __typename
78d63
< __typename
107d91
< __typename
109d92
< __typename
111d93
< __typename
113d94
< __typename
115d95
< __typename
117d96
< __typename
119d97
< __typename |
Started getting this error when I passed my schema.json to
cacheExchange
. Seems to be because__Schema
is not defined in my schema.json. Does not seem to have any actual effects and can safely be ignored, but the error should still be fixed.Possibly related to #269, urql-graphql/urql#889
The text was updated successfully, but these errors were encountered: