File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
apollo-client/v3/schema-driven-testing/src/__tests__ Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import graphqlSchema from "../../../schema.graphql";
99
1010const staticSchema = makeExecutableSchema ( { typeDefs : graphqlSchema } ) ;
1111
12- export let schemaProxy = createTestSchema ( staticSchema , {
12+ export let testSchema = createTestSchema ( staticSchema , {
1313 resolvers : {
1414 Query : {
1515 products : ( ) => [
@@ -27,12 +27,12 @@ export let schemaProxy = createTestSchema(staticSchema, {
2727 } ,
2828} ) ;
2929
30- export function replaceSchema ( newSchema : typeof schemaProxy ) {
31- const oldSchema = schemaProxy ;
32- schemaProxy = newSchema ;
30+ export function replaceSchema ( newSchema : typeof testSchema ) {
31+ const oldSchema = testSchema ;
32+ testSchema = newSchema ;
3333
3434 function restore ( ) {
35- schemaProxy = oldSchema ;
35+ testSchema = oldSchema ;
3636 }
3737
3838 return Object . assign ( restore , {
@@ -50,7 +50,7 @@ export const handlers = [
5050 const result = await execute ( {
5151 document,
5252 operationName,
53- schema : schemaProxy ,
53+ schema : testSchema ,
5454 variableValues : variables ,
5555 } ) ;
5656
Original file line number Diff line number Diff line change 88import { Products } from "../../products" ;
99import { server } from "../mocks/server" ;
1010import { makeClient } from "../../client" ;
11- import { replaceSchema , schemaProxy } from "../mocks/handlers" ;
11+ import { replaceSchema , testSchema } from "../mocks/handlers" ;
1212
1313// The following server set-up, reset and teardown would normally be
1414// done in a `setupTests.ts` file. Since we're using Jest to run both
@@ -39,7 +39,7 @@ describe("Products", () => {
3939 } ) ;
4040
4141 test ( "allows resolvers to be updated via .add" , async ( ) => {
42- schemaProxy . add ( {
42+ testSchema . add ( {
4343 resolvers : {
4444 Query : {
4545 products : ( ) => {
@@ -63,7 +63,7 @@ describe("Products", () => {
6363 } ) ;
6464
6565 test ( "allows resolvers to be updated via .fork and replaceSchema" , async ( ) => {
66- const newSchema = schemaProxy . fork ( {
66+ const newSchema = testSchema . fork ( {
6767 resolvers : {
6868 Query : {
6969 products : ( ) => {
@@ -89,7 +89,7 @@ describe("Products", () => {
8989 } ) ;
9090
9191 test ( "handles test schema resetting via .reset" , async ( ) => {
92- schemaProxy . reset ( ) ;
92+ testSchema . reset ( ) ;
9393
9494 render ( makeClient ( ) ) ;
9595
You can’t perform that action at this time.
0 commit comments