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

Provide example for GraphQL usage #52

Closed
Voycawojka opened this issue Oct 11, 2019 · 0 comments
Closed

Provide example for GraphQL usage #52

Voycawojka opened this issue Oct 11, 2019 · 0 comments

Comments

@Voycawojka
Copy link
Contributor

Is your feature request related to a problem? Please describe.
There is no example of GraphQL usage with !x.

Describe the solution you'd like
Possible implementation revolves around using !x tasks in GraphQL data fetchers.
Requires:

  • java graphql implementation (repo)
  • vertx wrapper of the java graphql (doc)

Java GraphQL provides needed implementation itself while Vert.x wrapper provides HTTP handler for GraphQL.

We can implement graphql handler factory (implementing RoutingHandlerFactory) that would configure GraphQL object and return GraphQLHandler from Vertx. GraphQL schema could be provided via configuration in operations.conf (either as a string or as a path to a file with the schema).

GraphQL uses data fetchers as an integration layer. Each type defined in schema needs to have a data fetcher assigned. In the java implementation it needs to be assigned to the GraphQL object before passing it to the http handler (so fetchers need to be assigned in graphql handler factory). Data fetcher is just an object implementing DataFetcher. The idea is to have it run !x tasks. This way !x is still responsible for providing data from integrations.

FragmentsEngine (directly or indirectly via FragmentsHandler) could be used to process tasks defined in configuration. DataFetcher logic would probably be universal or almost universal. It would be better to have it universal if possible. This way there would be no need for hardcoding any connections between schema types and data fetchers.

Describe alternatives you've considered
If some genericity can be extracted then GraphQL support could be implemented in !x.

Additional context
No context, but here's a cat emoji: 🐱

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

No branches or pull requests

2 participants