Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement subscription #94

Closed
wants to merge 15 commits into from
20 changes: 20 additions & 0 deletions src/__tests__/execution.test.ts
Expand Up @@ -1258,4 +1258,24 @@ describe("dx", () => {
expect(isCompiledQuery(compiledQuery)).toBe(true);
expect(compiledQuery.query.name).toBe("mockOperationName");
});
test("function name of the bound query (subscription)", async () => {
const schema = new GraphQLSchema({
query: new GraphQLObjectType({
name: "TypeZ",
fields: {
a: { type: GraphQLString }
}
}),
subscription: new GraphQLObjectType({
name: "Type",
fields: {
a: { type: GraphQLString }
}
})
});
const document = parse(`subscription mockOperationName { a }`);
const compiledQuery = compileQuery(schema, document) as CompiledQuery;
expect(isCompiledQuery(compiledQuery)).toBe(true);
expect(compiledQuery.subscribe!.name).toBe("mockOperationName");
});
});