From a768575ac1454587208aad63abc811b6a966fe72 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Tue, 9 Jul 2024 12:41:24 -0600 Subject: [PATCH] Deprecate experimental testing utilities (#11930) --- .api-reports/api-report-testing_experimental.api.md | 4 ++-- .changeset/weak-ads-develop.md | 5 +++++ src/testing/experimental/createSchemaFetch.ts | 2 ++ src/testing/experimental/createTestSchema.ts | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/weak-ads-develop.md diff --git a/.api-reports/api-report-testing_experimental.api.md b/.api-reports/api-report-testing_experimental.api.md index 97af4a043cf..330f543fc64 100644 --- a/.api-reports/api-report-testing_experimental.api.md +++ b/.api-reports/api-report-testing_experimental.api.md @@ -8,7 +8,7 @@ import type { FieldNode } from 'graphql'; import type { FragmentDefinitionNode } from 'graphql'; import type { GraphQLSchema } from 'graphql'; -// @alpha +// @alpha @deprecated export const createSchemaFetch: (schema: GraphQLSchema, mockFetchOpts?: { validate?: boolean; delay?: { @@ -24,7 +24,7 @@ export const createSchemaFetch: (schema: GraphQLSchema, mockFetchOpts?: { // Warning: (ae-forgotten-export) The symbol "TestSchemaOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ProxiedSchema" needs to be exported by the entry point index.d.ts // -// @alpha +// @alpha @deprecated export const createTestSchema: (schemaWithTypeDefs: GraphQLSchema, options: TestSchemaOptions) => ProxiedSchema; // @public diff --git a/.changeset/weak-ads-develop.md b/.changeset/weak-ads-develop.md new file mode 100644 index 00000000000..2499c7cb871 --- /dev/null +++ b/.changeset/weak-ads-develop.md @@ -0,0 +1,5 @@ +--- +"@apollo/client": minor +--- + +Deprecates experimental schema testing utilities introduced in 3.10 in favor of recommending [`@apollo/graphql-testing-library`](https://github.com/apollographql/graphql-testing-library). diff --git a/src/testing/experimental/createSchemaFetch.ts b/src/testing/experimental/createSchemaFetch.ts index fe253f98899..9f018156cf1 100644 --- a/src/testing/experimental/createSchemaFetch.ts +++ b/src/testing/experimental/createSchemaFetch.ts @@ -30,6 +30,8 @@ import { wait } from "../core/wait.js"; * ``` * @since 3.10.0 * @alpha + * @deprecated `createSchemaFetch` is deprecated and will be removed in 3.12.0. + * Please migrate to [`@apollo/graphql-testing-library`](https://github.com/apollographql/graphql-testing-library). */ const createSchemaFetch = ( schema: GraphQLSchema, diff --git a/src/testing/experimental/createTestSchema.ts b/src/testing/experimental/createTestSchema.ts index 5a4002c2902..e07dd923e4e 100644 --- a/src/testing/experimental/createTestSchema.ts +++ b/src/testing/experimental/createTestSchema.ts @@ -50,6 +50,8 @@ interface TestSchemaOptions { * ``` * @since 3.9.0 * @alpha + * @deprecated `createTestSchema` is deprecated and will be removed in 3.12.0. + * Please migrate to [`@apollo/graphql-testing-library`](https://github.com/apollographql/graphql-testing-library). */ const createTestSchema = ( schemaWithTypeDefs: GraphQLSchema,