Skip to content

Commit

Permalink
use toMatchObject to expose difference
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangvvo committed Jan 30, 2021
1 parent eaa4dce commit 7937b3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/subscription.test.ts
@@ -1,5 +1,5 @@
/**
* Based on https://github.com/graphql/graphql-js/blob/master/src/subscription/subscribe.js
* Based on https://github.com/graphql/graphql-js/blob/main/src/subscription/__tests__/subscribe-test.js
* This test suite makes an addition denoted by "*" comments:
* graphql-jit does not support the root resolver pattern that this test uses
* so the part must be rewritten to include that root resolver in `subscribe` of
Expand Down Expand Up @@ -544,7 +544,7 @@ describe("Subscription Initialization Phase", () => {
`)
});

expect(result).toEqual({
expect(result).toMatchObject({
errors: [
{
message: "test error",
Expand Down
7 changes: 0 additions & 7 deletions src/execution.ts
Expand Up @@ -34,7 +34,6 @@ import { ExecutionContext as GraphQLContext } from "graphql/execution/execute";
import { FieldNode, OperationDefinitionNode } from "graphql/language/ast";
import mapAsyncIterator from "graphql/subscription/mapAsyncIterator";
import { GraphQLTypeResolver } from "graphql/type/definition";

import { pathToArray } from "graphql/jsutils/Path";
import {
addPath,
Expand Down Expand Up @@ -191,7 +190,6 @@ interface InternalCompiledQuery extends CompiledQuery {
* @param partialOptions compilation options to tune the compiler features
* @returns {CompiledQuery} the cacheable result
*/

export function compileQuery(
schema: GraphQLSchema,
document: DocumentNode,
Expand All @@ -212,7 +210,6 @@ export function compileQuery(
) {
throw new Error("resolverInfoEnricher must be a function");
}

try {
const options = {
disablingCapturingStackErrors: false,
Expand All @@ -238,14 +235,12 @@ export function compileQuery(
} else {
stringify = JSON.stringify;
}

const getVariables = compileVariableParsing(
schema,
context.operation.variableDefinitions || []
);

const functionBody = compileOperation(context);

const compiledQuery: InternalCompiledQuery = {
query: createBoundQuery(
context,
Expand Down Expand Up @@ -405,7 +400,6 @@ function compileOperation(context: CompilationContext) {
Object.create(null),
Object.create(null)
);

const topLevel = compileObjectType(
context,
type,
Expand All @@ -417,7 +411,6 @@ function compileOperation(context: CompilationContext) {
fieldMap,
true
);

let body = `function query (${GLOBAL_EXECUTION_CONTEXT}) {
"use strict";
`;
Expand Down

0 comments on commit 7937b3b

Please sign in to comment.