Question: additionalTypeDefs and additionalResolvers #1885
Unanswered
ducthang-vu
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've recently start using Mesh and I think it's great.
I'd like to ask a (noob) question about an issue I have with adding additional resolvers that I am not able to figure out.
I'm using the OpenAPI / Swagger handler to generate a GraphQL interface from a remote source (only one source).
The handler generates the followin types and queries (simplified example):
Notice that carGet returns all cars in db if no userName is given, otherwise returns all car of the particular owner.
I did the following in the .meshrc.yaml file:
It works.
I then tried the following:
The last attempt fails, and the cars field always return null, without any error notification.
I tried to add the resolver with a js code, and the it turns out that the following error is raised:
It seems that the issue is with the info object that is passed to the resolver, where info.path.prev is "undefined".
I'd like understand if my attempt is sound, and if so how can I correct the error.
Beta Was this translation helpful? Give feedback.
All reactions