Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Custom resolvers #80

Open
b1zzu opened this issue Nov 28, 2019 · 4 comments
Open

Custom resolvers #80

b1zzu opened this issue Nov 28, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@b1zzu
Copy link
Contributor

b1zzu commented Nov 28, 2019

Custom resolvers are defenitly a must-have from graphql-testsx, but the way in which we could implement them is still an open question. What we should have is the possibility to define custom queries/mutations/subscriptions or fields in the datamodel and then manually pass the resolver method to the TestxServer. I would also like to make available to the resolver method the DataProvider and CRUDService so that the user could leverage them to build more useful resolvers.

We are looking into different ideas, thoughts, or feedbacks for this issue 🎉

@wtrocki
Copy link
Contributor

wtrocki commented Nov 28, 2019

Custom resolvers will be resolver functions attached to some objects
When creating runtime we getting a bunch of generated functions so we can simply merge them together:

Object.assign(runtime.resolvers, myCustomResolvers)

Having some helper for that will be big plus

@b1zzu
Copy link
Contributor Author

b1zzu commented Nov 28, 2019

@wtrocki the main idea is to add some helpers, or at least give the custom resolver acess to the database, but we could split this in two separate tasks

@wtrocki
Copy link
Contributor

wtrocki commented Nov 28, 2019

@b1zzu Perfect. This is where services will work nicely. Custom resolvers can base on existing services, however, having helper will be really nice (we can add that to graphback runtime

@b1zzu b1zzu added the enhancement New feature or request label Dec 5, 2019
@b1zzu b1zzu added the blocked label Dec 5, 2019
@b1zzu
Copy link
Contributor Author

b1zzu commented Dec 5, 2019

Blocked by: #103

@b1zzu b1zzu removed the blocked label Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants