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

Brian/version 4 defer stream #6376

Closed
Closed
Show file tree
Hide file tree
Changes from all 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,419 changes: 1,183 additions & 1,236 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"cors": "2.8.5",
"cspell": "5.20.0",
"express": "4.18.1",
"graphql": "16.3.0",
"graphql": "16.4.0-canary.pr.2839.e3a8069cfaa6406186314b62aced6487f417a2e6",
"graphql-tag": "2.12.6",
"jest": "27.5.1",
"jest-config": "27.5.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"dependencies": {
"@apollo/usage-reporting-protobuf": "^3.3.0",
"@apollo/utils.createhash": "^1.1.0",
"@apollo/utils.fetcher": "^1.0.0",
"@apollo/utils.isnodelike": "^1.1.0",
"@apollo/utils.logger": "^1.0.0",
"@apollo/utils.fetcher": "^1.0.0",
"@apollographql/graphql-playground-html": "1.6.29",
"@graphql-tools/mock": "^8.1.2",
"@graphql-tools/schema": "^8.0.0",
Expand All @@ -50,7 +50,7 @@
"uuid": "^8.0.0"
},
"peerDependencies": {
"graphql": "^16.3.0"
"graphql": "^16.4.0-canary.pr.2839.e3a8069cfaa6406186314b62aced6487f417a2e6"
},
"volta": {
"extends": "../../package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/server/src/ApolloServer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { isNodeLike } from '@apollo/utils.isnodelike';
import type { Logger } from '@apollo/utils.logger';
// TODO(brian): Does this utility have to be updated for AS4?
import { addMocksToSchema } from '@graphql-tools/mock';
import { makeExecutableSchema } from '@graphql-tools/schema';
import resolvable, { Resolvable } from '@josephg/resolvable';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ export async function collectCacheControlHintsAndPolicyIfCacheable(
query: source,
},
executor: async (requestContext) => {
return await graphql({
return await (graphql({
schema,
source: requestContext.request.query,
contextValue: requestContext.contextValue,
});
// TODO(brian): why
}) as any);
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ describe('end-to-end', () => {
query: 'query { __typename }',
},
executor: async ({ request: { query }, contextValue }) => {
return await graphql({
return await (graphql({
schema: makeExecutableSchema({ typeDefs: 'type Query { foo: Int }' }),
source: query,
// context is needed for schema instrumentation to find plugins.
contextValue,
});
// TODO(brian): I promise not to leave this here I’m just
// experimenting
}) as any);
},
});
}
Expand Down
3 changes: 2 additions & 1 deletion packages/server/src/__tests__/pluginTestHarness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export default async function pluginTestHarness<TContext>({
*/
executor: (
requestContext: IPluginTestHarnessExecutionDidStart<TContext>,
) => Promise<GraphQLResponse>;
// TODO(brian): I will get to the bottom of this.
) => Promise<GraphQLResponse | any>;

/**
* (optional) To provide a user context, if necessary.
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/requestPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export async function processGraphQLRequest<TContext extends BaseContext>(
// (eg usage reporting) assumes that.
return await internals.executor(requestContext);
} else {
return await graphqlExecute(executionArgs);
return await (graphqlExecute(executionArgs) as any);
}
}

Expand Down