-
Notifications
You must be signed in to change notification settings - Fork 66
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
enhancement: support introspection #798
Conversation
Add filtering functionality to GraphQL API; add E2E tests
β¦ueries (#755) * Add comments; rename to clearer variables * Add sorting and offset-based pagination
* Add PageInfo object to queries with a limit * Adjust tests * Change API response to snake_case
* Add docs for GraphQL filtering and pagination * Move QueryResponse to models module * Address rvmelkonian feedback * Address ra0x3 feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing the PR locally here, I see the error
{
"error": "Introspection result missing interfaces: { fields: [[Object]], kind: \"OBJECT\", name: \"Query\" }."
}
@luizstacio I forgot to mention in the PR description, that error shows on initial page load, but if you run the introspection query, it should work. Could you try that? Meanwhile I'll see if I can suppress that error on page load. |
@rvmelkonian
|
@ra0x3 I had a sync with @luizstacio late last night. The scope of this PR was just to do the introspection query and get the response back with the schema data (this is used for TS code gen). To get the schema and docs stuff to work in the playground, I would consider a separate PR as that involves editing JS and html from Did you try out the query in the description and get back a successful response? |
@rvmelkonian Sounds good. I'll defer to @luizstacio for approval in terms of functionality working properly |
Docs and Schema tabs are loaded using the return of the introspect query, to be a valid return it should be loading this tabs also, this would give you the certainty that is working. I was talk with @deekerno yesterday about investigate the possibility to use I'm mentioning this here, because if @deekerno is looking into it, this work may not be needed? |
@deekerno Will defer to you with regard to @luizstacio 's comment here. |
@ra0x3 @deekerno In that case I'll put this PR on hold then #800 as I'm making heavy use of our current graphql parser. I'm all up for shifting to |
It will definitely require some rewrites; I think it's just a question of how many and how much effort we're willing to put into it. It seems like it may be a net positive as far as type safety, but I'm still investigating prior art to see if we would lose any speed or start running into any sort of "N+1 problem" when it comes to queries. I'll update you all on Slack. |
@luizstacio the logic for fetching the schema and docs is tucked away inside |
Closing this as |
Closes #790
See the issue for full context, it's all there π
Changelog
β’ Add
introspect
method onSchema
struct.β’ Updates
query_graph
handler function to check for introspection and return that if requested.β’ Updates documentation.
Testing
cargo run --bin fuel-indexer -- run --manifest packages/fuel-indexer-tests/components/indices/fuel-indexer-test/fuel_indexer_test.yaml
http://localhost:29987/api/playground/fuel_indexer_test/index1
(For extra testing you can test normal queries and other indexers, I did this, but if you're in a QA type of mood... )
You should get the response
Note
mutationType
andsubscriptionType
fields have been set to null.