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'm trying to implement a live directive, which keeps the caller of the query up-to-date.
This is my current code, which does just resolve() with the directive.
consttypeDefs=/* GraphQL */` directive @live on FIELD | FIELD_DEFINITION type Todo { text: String! completed: Boolean! } type Query { allTodos: [Todo]! @live }`;constresolvers={Query: {allTodos(){returnsomeTodoArray;}}};constexecutableSchema=makeExecutableSchema({
typeDefs,
resolvers
});addDirectiveResolveFunctionsToSchema(executableSchema,{live(resolve){returnresolve();}});
How would I push new results to the caller with this approach?
Is there a way to get a reference to the caller to push new results?
The text was updated successfully, but these errors were encountered:
eljenso
changed the title
Implement a live directive
Implementing a live directive
Apr 11, 2018
I'm trying to implement a live directive, which keeps the caller of the query up-to-date.
This is my current code, which does just
resolve()
with the directive.How would I push new results to the caller with this approach?
Is there a way to get a reference to the caller to push new results?
The text was updated successfully, but these errors were encountered: