diff --git a/graphql-17.0.0-alpha.9.tgz b/graphql-17.0.0-alpha.9.tgz new file mode 100644 index 00000000000..36f74553cfd Binary files /dev/null and b/graphql-17.0.0-alpha.9.tgz differ diff --git a/package-lock.json b/package-lock.json index 6bda573d157..8056e5341d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,6 +41,7 @@ "graphql": "16.11.0", "graphql-subscriptions": "3.0.0", "graphql-tag": "2.12.6", + "graphql17": "file:graphql-17.0.0-alpha.9.tgz", "jest": "30.0.5", "jest-config": "30.0.5", "jest-junit": "16.0.0", @@ -8693,6 +8694,17 @@ "graphql": ">=0.11 <=16" } }, + "node_modules/graphql17": { + "name": "graphql", + "version": "17.0.0-alpha.9", + "resolved": "file:graphql-17.0.0-alpha.9.tgz", + "integrity": "sha512-+hYNzG/Se4p1STHPblhVjhFWZf0rwffLHuDZ78YpyfR9vQ92pNfSq+DMbZFewAm/S+HXIOn7d+jrvmVIzLnejQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/handlebars": { "version": "4.7.8", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", diff --git a/package.json b/package.json index 31c5ec41b32..52f895408d2 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "graphql": "16.11.0", "graphql-subscriptions": "3.0.0", "graphql-tag": "2.12.6", + "graphql17": "file:graphql-17.0.0-alpha.9.tgz", "jest": "30.0.5", "jest-config": "30.0.5", "jest-junit": "16.0.0", diff --git a/packages/server/jest.config.js b/packages/server/jest.config.js index 26dd944c18c..3215ffcd4b5 100644 --- a/packages/server/jest.config.js +++ b/packages/server/jest.config.js @@ -2,4 +2,9 @@ import baseConfig from '../../jest.config.base.js'; // This needs to be "cloned" since jest depends on the object's identity in some // way, whether it's via mutation or something else. -export default { ...baseConfig }; +export default { + ...baseConfig, + testEnvironmentOptions: { + customExportConditions: ['node', 'development'], + }, +}; diff --git a/packages/server/src/__tests__/testGraphql17DevMode.test.ts b/packages/server/src/__tests__/testGraphql17DevMode.test.ts new file mode 100644 index 00000000000..4f148ce24e1 --- /dev/null +++ b/packages/server/src/__tests__/testGraphql17DevMode.test.ts @@ -0,0 +1,22 @@ +import { describe, it, expect } from '@jest/globals'; +import { GraphQLObjectType, isObjectType, version } from 'graphql17'; + +describe('canary graphql v17-alpha', () => { + it('should work', () => { + expect(version).toBe('17.0.0-alpha.9'); // this version is the latest alpha on which the canary is based + }); + + it('should use development mode when set by our Jest Config', () => { + function getFakeGraphQLObjectType() { + class GraphQLObjectType { + get [Symbol.toStringTag]() { + return 'GraphQLObjectType'; + } + } + return new GraphQLObjectType(); + } + + expect(isObjectType(new GraphQLObjectType({ name: 'SomeType', fields: {} }))).toBe(true); + expect(() => isObjectType(getFakeGraphQLObjectType())).toThrow(); + }); +});