Skip to content

[Federation] Add queryHash to GraphQLExecutor#2822

Merged
jbaxleyiii merged 1 commit intoapollographql:masterfrom
Pruxis:patch-1
Jun 12, 2019
Merged

[Federation] Add queryHash to GraphQLExecutor#2822
jbaxleyiii merged 1 commit intoapollographql:masterfrom
Pruxis:patch-1

Conversation

@Pruxis
Copy link
Copy Markdown
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