graphql-testx
graphql-testx copied to clipboard
Custom resolvers
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 :tada:
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
@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
@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
Blocked by: #103