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

Add extensions support #448

Merged
merged 16 commits into from
Mar 28, 2019
Merged

Add extensions support #448

merged 16 commits into from
Mar 28, 2019

Conversation

Fontinalis
Copy link
Collaborator

@Fontinalis Fontinalis commented Feb 21, 2019

I added an Extension interface that enables to build extensions for the graphql package.
Using that, we can add support for the extensions and add tracing as an extension.

Added an example examples/star-wars-with-trace that shows how we could add a tracing extension.

Using the interface we could add different extensions based on different tracing providers.

I'm interested in any kind of feedback, happy to work on this more.

Update 1:
Removed the example from the repo, and created one here
Fontinalis/graphql-tracing-example

@Fontinalis Fontinalis changed the title Add extensions support WIP: Add extensions support Feb 21, 2019
@Fontinalis Fontinalis changed the title WIP: Add extensions support Add extensions support Feb 21, 2019
@coveralls
Copy link

coveralls commented Feb 21, 2019

Coverage Status

Coverage increased (+0.2%) to 92.338% when pulling b92b14d on Fontinalis:extensions into cc858c0 on graphql-go:master.

@Fontinalis
Copy link
Collaborator Author

FYI there’s an example at graphql-tracing-example which is a simple opentracing example based on this PR

@Fontinalis
Copy link
Collaborator Author

@chris-ramon Any update on when this will be merged or reviewed?

@Fontinalis
Copy link
Collaborator Author

@chris-ramon Any luck with looking into this and make some feedback on the PR?

@chris-ramon
Copy link
Member

@Fontinalis thanks a lot for working on this 👍 💯

I've being following the progress and this looks really great to me, the extensions API is small and simple to use.

Also thanks for putting altogether and creating a neat example:

image

Merging this one and let's address further improvements in a follow-up PRs.

@chris-ramon chris-ramon merged commit 2b0b734 into graphql-go:master Mar 28, 2019
@zonr
Copy link
Contributor

zonr commented Mar 28, 2019

My two cents:

  1. "Extension" may not be a good name under the context of Schema because it may cause confusion with Schema Extension defined in GraphQL specification.
  1. graphql-js plans to add middleware ([Feature Request] Resolver Middleware graphql/graphql-js#1516) in v15 to allow extended behaviors to be added to resolvers and schema.
  • But I guess they may not have that many hooks as in this PR such as ParseDidStart and ValidationDidStart, etc..
  1. The design currently binds Extensions to Schema. What do you think to pass it as part of ExecuteParams?

In any way, many thanks again for your hard work to bring this feature!

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

4 participants