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

[Federation] Add queryHash to GraphQLExecutor #2822

Merged
merged 1 commit into from
Jun 12, 2019

Conversation

Pruxis
Copy link
Contributor

@Pruxis Pruxis commented Jun 11, 2019

Currently due to core-package not allowing queryHash

You have the following error when building an ApolloGateway with Typescript.

Property 'executor' in type 'ApolloGateway' is not assignable to the same property in base type 'GraphQLService'.
  Type '<TContext>(requestContext: WithRequired<GraphQLRequestContext<TContext>, "document" | "operation" | "queryHash">) => Promise<GraphQLExecutionResult>' is not assignable to type 'GraphQLExecutor<Record<string, any>>'.
    Types of parameters 'requestContext' and 'requestContext' are incompatible.
      Type 'WithRequired<GraphQLRequestContext<Record<string, any>>, "document" | "operationName" | "operation">' is not assignable to type 'WithRequired<GraphQLRequestContext<Record<string, any>>, "document" | "operation" | "queryHash">'.
        Type 'WithRequired<GraphQLRequestContext<Record<string, any>>, "document" | "operationName" | "operation">' is not assignable to type 'Required<Pick<GraphQLRequestContext<Record<string, any>>, "document" | "operation" | "queryHash">>'.
          Property 'queryHash' is optional in type 'GraphQLRequestContext<Record<string, any>> & Required<Pick<GraphQLRequestContext<Record<string, any>>, "document" | "operationName" | "operation">>' but required in type 'Required<Pick<GraphQLRequestContext<Record<string, any>>, "document" | "operation" | "queryHash">>'.ts(2416)

By allowing queryHash this should be fixed.

Currently due to core-package not allowing queryHash

You have the following error when building an ApolloGateway with Typescript.
Property 'executor' in type 'ApolloGateway' is not assignable to the same property in base type 'GraphQLService'.
  Type '<TContext>(requestContext: WithRequired<GraphQLRequestContext<TContext>, "document" | "operation" | "queryHash">) => Promise<GraphQLExecutionResult>' is not assignable to type 'GraphQLExecutor<Record<string, any>>'.
    Types of parameters 'requestContext' and 'requestContext' are incompatible.
      Type 'WithRequired<GraphQLRequestContext<Record<string, any>>, "document" | "operationName" | "operation">' is not assignable to type 'WithRequired<GraphQLRequestContext<Record<string, any>>, "document" | "operation" | "queryHash">'.
        Type 'WithRequired<GraphQLRequestContext<Record<string, any>>, "document" | "operationName" | "operation">' is not assignable to type 'Required<Pick<GraphQLRequestContext<Record<string, any>>, "document" | "operation" | "queryHash">>'.
          Property 'queryHash' is optional in type 'GraphQLRequestContext<Record<string, any>> & Required<Pick<GraphQLRequestContext<Record<string, any>>, "document" | "operationName" | "operation">>' but required in type 'Required<Pick<GraphQLRequestContext<Record<string, any>>, "document" | "operation" | "queryHash">>'.ts(2416)

By allowing queryHash this should be fixed.
@jbaxleyiii jbaxleyiii merged commit 858a20e into apollographql:master Jun 12, 2019
@Pruxis Pruxis deleted the patch-1 branch June 13, 2019 06:14
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants