-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: limit functions exposed in indexing status API #55
Conversation
478befd
to
18882a1
Compare
Pull Request Test Coverage Report for Build 6332462657
💛 - Coveralls |
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.
Simple and effective solution.
I think graphql_parser
could have worked, but it would have been up to you to write a graph visitor to look for all the fields of the generated AST. More complex to write though, and probably worth it only if there's a need for a fancier GQL manipulations.
18882a1
to
4392c10
Compare
@aasseman Thank you for the review! I've updated to use
I agree, was well on my way in handling different GraphQL executions with |
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.
limit indexing status to serve supported root fields:
indexingStatuses, publicProofsOfIndexing, entityChangesInBlock, blockData, cachedEthereumCalls, subgraphFeatures, apiVersions
So queries with root fields like
indexingStatusForCurrentVersion, indexingStatusForPendingVersion, indexingStatusesForSubgraphName, ...
should fail with bad request with a hint on the unsupported fieldsUsing
Regex
is brutal but get the job done while I didn't find similar functions in graphql crates likeasync-graphql
andgraphql-parser
(also searched ingraphql-tools-rs
maintained by the guild.Resolve #6