You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Mesh to consume many graphs (mostly from TheGraph) and some Rest API.
I have 2 question concerning the context object in an additionalResolver:
It is possible to use aliases ?
Is it possible to pass some args to a nested field of that query ?
Query example that will do both:
queryGetAccounts($first: Int!) {
# Alias 1accounts1: accounts {
idbalances(first: $first) { # first need to be a paramid
}
}
# Alias 2accounts2: accounts {
idbalances(first: $first) { # first need to be a paramid
}
}
}
Is it possible to obtain the same result of that query using only context.MyGraph.Query.accounts ? Actually, the args param of the query in the context can't let me pass anything to nested field. And I didn't found a way to use Aliases with selectionSet.
I also tried to create a document with that query inside and use getMeshSDK instead of context. It works fine, but since I also need to use filterSchema to filter everything except the few fields I'm programmatically creating, the following error pop up: Cannot query field "accounts" on type "Query" since accounts become filtered.
In our case, ✨ Mesh ✨ seems to be our best option to 'merge' all our graphs and API, but I'm facing those issue and can't find any workaround. Help will be appreciated 🫶
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey 👋
I use Mesh to consume many graphs (mostly from TheGraph) and some Rest API.
I have 2 question concerning the
context
object in an additionalResolver:aliases
?Query example that will do both:
Is it possible to obtain the same result of that query using only
context.MyGraph.Query.accounts
? Actually, theargs
param of the query in the context can't let me pass anything to nested field. And I didn't found a way to use Aliases with selectionSet.I also tried to create a document with that query inside and use
getMeshSDK
instead ofcontext
. It works fine, but since I also need to usefilterSchema
to filter everything except the few fields I'm programmatically creating, the following error pop up:Cannot query field "accounts" on type "Query"
sinceaccounts
become filtered.In our case, ✨ Mesh ✨ seems to be our best option to 'merge' all our graphs and API, but I'm facing those issue and can't find any workaround. Help will be appreciated 🫶
Beta Was this translation helpful? Give feedback.
All reactions