Skip to content

X-GraphQL-Keys not returned when using queryid instead of queryId #293

@jasonbahl

Description

@jasonbahl

When using all lowercase queryid instead of camelCase queryId the X-GraphQL-Keys are not returned in the headers.

If keys are not returned in headers, then the cached document cannot be tagged properly and thus caches cannot be purged properly based on the tags (that were not returned in the headers).

Steps to reproduce

With WPGraphQL and WPGraphQL Smart Cache active, create a new "GraphQL Document"

CleanShot 2024-08-29 at 13 56 55

Copy the ID of the persisted GraphQL Document:

CleanShot 2024-08-29 at 13 57 12

In an incognito window (or using Postman, etc), execute a GET request to your GraphQL endpoint using ?queryId=${yourId}

See the X-GraphQL-Keys in the response:

CleanShot 2024-08-29 at 14 06 40

Now, try again in a new incognito browser tab but using lowercase queryid instead of camelCase queryId and see that the X-GraphQL-Keys are not generated:;

CleanShot 2024-08-29 at 14 05 28

Proposal

Since the query properly executes and returns results for both queryId and queryid we should support the key generation for both query params.

Metadata

Metadata

Assignees

Labels

type: bugIssue that causes incorrect or unexpected behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions