-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
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.
const typeDefs = /* GraphQL */ `
directive @live on FIELD | FIELD_DEFINITION
type Todo {
text: String!
completed: Boolean!
}
type Query {
allTodos: [Todo]! @live
}
`;
const resolvers = {
Query: {
allTodos() {
return someTodoArray;
}
}
};
const executableSchema = makeExecutableSchema({
typeDefs,
resolvers
});
addDirectiveResolveFunctionsToSchema(executableSchema, {
live(resolve) {
return resolve();
}
});
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?
Metadata
Metadata
Assignees
Labels
No labels