Skip to content
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

Select all types in pre-introspection query #5547

Merged
merged 3 commits into from Jan 22, 2024
Merged

Conversation

BoD
Copy link
Contributor

@BoD BoD commented Jan 19, 2024

api.github.com doesn't like querying too many introspection elements:

{
  "errors": [
    {
      "type": "INTROSPECTION_LIMIT_EXCEEDED",
      "message": "Introspection fields may only be used 2 times, but some fields were used more than that: __Type.fields (5), __Field.args (5)"
    }
  ]
}

We can be lenient in that case, and still try to execute the basic introspection query.

Copy link

netlify bot commented Jan 19, 2024

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit c49c633
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/65ae4f4ec38a6400087b8b6a

Copy link
Contributor

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we report that to GitHub? This feels sketchy especially given a "regular" introspection query will return more data.

In the meantime, I would change the query to make GitHub happy:

query PreIntrospectionQuery {
  __schema {
    types {
      ...TypeFields
    }
  }
}

This should reasonably work, right?

Comment on lines -4 to +8
schema: __type(name: "__Schema") { ...TypeFields }
type: __type(name: "__Type") { ...TypeFields }
directive: __type(name: "__Directive") { ...TypeFields }
field: __type(name: "__Field") { ...TypeFields }
inputValue: __type(name: "__InputValue") { ...TypeFields }
__schema {
types {
...TypeFields
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment linking to this PR?

@BoD BoD changed the title Try introspection even when pre-introspection doesn't work Select all types in pre-introspection query Jan 22, 2024
@BoD BoD merged commit f529a32 into main Jan 22, 2024
9 checks passed
@BoD BoD deleted the lenient-preintrospection-query branch January 22, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants