Skip to content

Conversation

@tyrone-digitalcake
Copy link

Graphql client content-type bug fix

WHY are these changes introduced?

Fixes #385 #385

Using the Graphql client to make a request with only the query as request data resulted into a 400 "Bad Request" error due to the application/graphql content-type header being removed.

WHAT is this pull request doing?

This request json encodes the request body also if the $data variable is not a string in Shopify\Clients\Graphql::query();

Before

Screenshot 2024-11-13 at 16 41 36

After

Screenshot 2024-11-13 at 16 42 52

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • [] I have added a changelog entry, prefixed by the type of change noted above
  • [] I have added/updated tests for this change
  • [] I have updated the documentation for public APIs from the library (if applicable)

@tyrone-digitalcake
Copy link
Author

I have signed the CLA!

Copy link
Contributor

@lizkenyon lizkenyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this fix. Releasing right away.

@lizkenyon
Copy link
Contributor

Some testes needed to be updated to a copied your change into #387 . I have released the fix.

@lizkenyon lizkenyon closed this Nov 13, 2024
@tyrone-digitalcake
Copy link
Author

My apologies for the tests, I’ll add them if I make a pull request in future.

Thank you for releasing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

version 5.8.0 breaking authentication and GraphQL API queries

2 participants