Skip to content

Commit

Permalink
move IncrementalSchemaLink and others to shared
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Dec 18, 2024
1 parent 2b91422 commit 7414a6b
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 17 deletions.
1 change: 1 addition & 0 deletions integration-test/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@apollo/server": "^4.11.2",
"@as-integrations/next": "^3.2.0",
"@graphql-tools/schema": "^10.0.0",
"@integration-test/shared": "workspace:^",
"@types/node": "20.3.1",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
Expand Down
4 changes: 2 additions & 2 deletions integration-test/nextjs/src/app/cc/ApolloWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import {
import { loadErrorMessages, loadDevMessages } from "@apollo/client/dev";
import { setVerbosity } from "ts-invariant";
import { delayLink } from "@/shared/delayLink";
import { schema } from "../graphql/schema";
import { schema } from "@integration-test/shared/schema";

import { useSSROnlySecret } from "ssr-only-secrets";
import { errorLink } from "../../shared/errorLink";
import { IncrementalSchemaLink } from "../graphql/IncrementalSchemaLink";
import { IncrementalSchemaLink } from "@integration-test/shared/IncrementalSchemaLink";

setVerbosity("debug");
loadDevMessages();
Expand Down
2 changes: 1 addition & 1 deletion integration-test/nextjs/src/app/graphql/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { startServerAndCreateNextHandler } from "@as-integrations/next";
import { ApolloServer } from "@apollo/server";
import { schema } from "./schema";
import { schema } from "@integration-test/shared/schema";

const server = new ApolloServer({
schema,
Expand Down
4 changes: 2 additions & 2 deletions integration-test/nextjs/src/app/rsc/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { setVerbosity } from "ts-invariant";
import { delayLink } from "@/shared/delayLink";
import { errorLink } from "@/shared/errorLink";

import { schema } from "../graphql/schema";
import { IncrementalSchemaLink } from "../graphql/IncrementalSchemaLink";
import { schema } from "@integration-test/shared/schema";
import { IncrementalSchemaLink } from "@integration-test/shared/IncrementalSchemaLink";

setVerbosity("debug");
loadDevMessages();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
useQueryRefHandlers,
useReadQuery,
} from "@apollo/client";
import { DeferredDynamicProductResult } from "../shared";
import { DeferredDynamicProductResult } from "@integration-test/shared/queries";
import { TransportedQueryRef } from "@apollo/experimental-nextjs-app-support";
import { useTransition } from "react";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApolloWrapper } from "@/app/cc/ApolloWrapper";
import { ClientChild } from "./ClientChild";
import { DEFERRED_QUERY } from "../shared";
import { DEFERRED_QUERY } from "@integration-test/shared/queries";

export const dynamic = "force-dynamic";
import { PreloadQuery } from "../../../client";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { QueryRef, useQueryRefHandlers } from "@apollo/client";
import { DynamicProductResult } from "../shared";
import { DynamicProductResult } from "@integration-test/shared/queries";
import { useEffect, useState } from "react";
import {
InternalQueryReference,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QUERY } from "../shared";
import { QUERY } from "@integration-test/shared/queries";
import { Suspense } from "react";
import { PreloadQuery } from "@/app/rsc/client";
import { RefTestChild } from "./RefTestChild";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useQueryRefHandlers, useReadQuery } from "@apollo/client";
import { DynamicProductResult } from "../shared";
import { DynamicProductResult } from "@integration-test/shared/queries";
import { TransportedQueryRef } from "@apollo/experimental-nextjs-app-support";

export function ClientChild({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApolloWrapper } from "@/app/cc/ApolloWrapper";
import { ClientChild } from "./ClientChild";
import { QUERY } from "../shared";
import { QUERY } from "@integration-test/shared/queries";

export const dynamic = "force-dynamic";
import { PreloadQuery } from "../../../client";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useSuspenseQuery } from "@apollo/client";
import { QUERY } from "../shared";
import { QUERY } from "@integration-test/shared/queries";

export function ClientChild() {
const { data } = useSuspenseQuery(QUERY);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApolloWrapper } from "@/app/cc/ApolloWrapper";
import { ClientChild } from "./ClientChild";
import { QUERY } from "../shared";
import { QUERY } from "@integration-test/shared/queries";

export const dynamic = "force-dynamic";
import { PreloadQuery } from "../../../client";
Expand Down
2 changes: 1 addition & 1 deletion integration-test/nextjs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "../shared/*.ts"],
"exclude": ["node_modules"]
}
6 changes: 5 additions & 1 deletion integration-test/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"name": "@integration-test/shared"
"name": "@integration-test/shared",
"peerDependencies": {
"@apollo/client": "*",
"graphql": "*"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TypedDocumentNode, gql } from "@apollo/client";
import { TypedDocumentNode, gql } from "@apollo/client/index.js";

export interface DynamicProductResult {
products: {
Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion integration-test/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2723,6 +2723,7 @@ __metadata:
"@apollo/server": "npm:^4.11.2"
"@as-integrations/next": "npm:^3.2.0"
"@graphql-tools/schema": "npm:^10.0.0"
"@integration-test/shared": "workspace:^"
"@playwright/test": "npm:^1.49.1"
"@types/node": "npm:20.3.1"
"@types/react": "npm:^19.0.0"
Expand All @@ -2747,9 +2748,12 @@ __metadata:
languageName: unknown
linkType: soft

"@integration-test/shared@workspace:shared":
"@integration-test/shared@workspace:^, @integration-test/shared@workspace:shared":
version: 0.0.0-use.local
resolution: "@integration-test/shared@workspace:shared"
peerDependencies:
"@apollo/client": "*"
graphql: "*"
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 7414a6b

Please sign in to comment.