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

chore: rename createProxiedSchema to createTestSchema #11764

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .api-reports/api-report-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ export const createMockSchema: (staticSchema: GraphQLSchema, mocks: {
// Warning: (ae-forgotten-export) The symbol "ProxiedSchema" needs to be exported by the entry point index.d.ts
//
// @alpha
export const createProxiedSchema: (schemaWithMocks: GraphQLSchema, resolvers: Resolvers) => ProxiedSchema;
export const createSchemaProxy: (schemaWithMocks: GraphQLSchema, resolvers: Resolvers) => ProxiedSchema;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createTestSchema{Wrapper}?


// @public (undocumented)
namespace DataProxy {
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-testing_core.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export const createMockFetch: (schema: GraphQLSchema, mockFetchOpts?: {
// Warning: (ae-forgotten-export) The symbol "ProxiedSchema" needs to be exported by the entry point index.d.ts
//
// @alpha
export const createProxiedSchema: (schemaWithMocks: GraphQLSchema, resolvers: Resolvers) => ProxiedSchema;
export const createSchemaProxy: (schemaWithMocks: GraphQLSchema, resolvers: Resolvers) => ProxiedSchema;

// @public (undocumented)
namespace DataProxy {
Expand Down
5 changes: 5 additions & 0 deletions .changeset/green-garlics-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": minor
---

Rename `createProxiedSchema` to `createSchemaProxy`
2 changes: 1 addition & 1 deletion config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const react17TestFileIgnoreList = [
ignoreTSFiles,
// We only support Suspense with React 18, so don't test suspense hooks with
// React 17
"src/testing/core/__tests__/createProxiedSchema.test.tsx",
"src/testing/core/__tests__/createSchemaProxy.test.tsx",
"src/react/hooks/__tests__/useSuspenseQuery.test.tsx",
"src/react/hooks/__tests__/useBackgroundQuery.test.tsx",
"src/react/hooks/__tests__/useLoadableQuery.test.tsx",
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/__snapshots__/exports.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ Array [
"createMockClient",
"createMockFetch",
"createMockSchema",
"createProxiedSchema",
"createSchemaProxy",
"itAsync",
"mockObservableLink",
"mockSingleLink",
Expand All @@ -390,7 +390,7 @@ Array [
"MockSubscriptionLink",
"createMockClient",
"createMockFetch",
"createProxiedSchema",
"createSchemaProxy",
"itAsync",
"mockObservableLink",
"mockSingleLink",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
spyOnConsole,
useTrackRenders,
} from "../../internal/index.js";
import { createProxiedSchema } from "../createProxiedSchema.js";
import { createSchemaProxy } from "../createSchemaProxy.js";
import { GraphQLError, buildSchema } from "graphql";
import type { UseSuspenseQueryResult } from "../../../react/index.js";
import { useMutation, useSuspenseQuery } from "../../../react/index.js";
Expand Down Expand Up @@ -147,7 +147,7 @@ describe("schema proxy", () => {
Date: () => new Date("January 1, 2024 01:00:00").toJSON().split("T")[0],
});

const schema = createProxiedSchema(schemaWithMocks, {
const schema = createSchemaProxy(schemaWithMocks, {
Query: {
viewer: () => ({
name: "Jane Doe",
Expand Down Expand Up @@ -849,7 +849,7 @@ describe("schema proxy", () => {
it("preserves resolvers from previous calls to .add on subsequent calls to .fork", async () => {
let name = "Virginia";

const schema = createProxiedSchema(schemaWithMocks, {
const schema = createSchemaProxy(schemaWithMocks, {
Query: {
viewer: () => ({
name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface ProxiedSchemaFns {
Date: () => new Date("December 10, 1815 01:00:00").toJSON().split("T")[0],
});
*
* const schema = createProxiedSchema(schemaWithMocks, {
* const schema = createSchemaProxy(schemaWithMocks, {
Query: {
writer: () => ({
name: "Ada Lovelace",
Expand All @@ -43,7 +43,7 @@ interface ProxiedSchemaFns {
* @since 3.9.0
* @alpha
*/
const createProxiedSchema = (
const createSchemaProxy = (
schemaWithMocks: GraphQLSchema,
resolvers: Resolvers
): ProxiedSchema => {
Expand All @@ -65,7 +65,7 @@ const createProxiedSchema = (
},

fork: ({ resolvers: newResolvers } = {}) => {
return createProxiedSchema(targetSchema, newResolvers ?? targetResolvers);
return createSchemaProxy(targetSchema, newResolvers ?? targetResolvers);
},

reset: () => {
Expand Down Expand Up @@ -116,4 +116,4 @@ const createProxiedSchema = (
return schema as ProxiedSchema;
};

export { createProxiedSchema };
export { createSchemaProxy };
2 changes: 1 addition & 1 deletion src/testing/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export { createMockClient } from "./mocking/mockClient.js";
export { default as subscribeAndCount } from "./subscribeAndCount.js";
export { itAsync } from "./itAsync.js";
export { wait, tick } from "./wait.js";
export { createProxiedSchema } from "./createProxiedSchema.js";
export { createSchemaProxy } from "./createSchemaProxy.js";
export { createMockFetch } from "./createMockFetch.js";
export * from "./withConsoleSpy.js";
Loading