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

Content-Type 'application/graphql' is no longer supported with graphql-dgs-spring-graphql-starter? #2016

Closed
martinvisser opened this issue Sep 25, 2024 · 4 comments
Assignees

Comments

@martinvisser
Copy link

Before I qualify this as a potential bug I just wanted to ask if application/graphql should still be supported as media type after switching from graphql-dgs-spring-boot-starter to graphql-dgs-spring-graphql-starter?
This used to be a valid media type as used in DgsRestController, but after switching to the new starter this controller is no longer used. Spring supports application/json and application/graphql-response+json, and deprecated support for application/graphql+json, but I don't see support for application/graphql.

@martinvisser martinvisser changed the title Content-Type 'application/graphql' is no longer supported? Content-Type 'application/graphql' is no longer supported with graphql-dgs-spring-graphql-starter? Sep 25, 2024
@martinvisser
Copy link
Author

Vice versa, it seems that application/graphql-response+json is not supported in DgsRestController.

@paulbakker
Copy link
Collaborator

I ran into this last week as well and reported it (over chat) to the Spring GraphQL maintainers. They'll have a look at it.
It should be supported, but seems to have an issue.

@martinvisser
Copy link
Author

I see it got added: spring-projects/spring-graphql#1038 / spring-projects/spring-graphql#1036.

What about application/graphql-response+json in DGS itself, is that supposed to be supported?

@paulbakker
Copy link
Collaborator

I retested this and using Content-Type: application/graphql seems to work (again).

There is a difference tho. In the current unpublished spec it expects JSON for a application/graphql request. In the original DGS implementation, the request would not be JSON, it would be expect the query itself to be the body of the request.
This no longer works.

While this is an unintentional breaking change, I think the Spring GraphQL behavior is what we want now, since that's where the spec is heading. The DGS behavior was based on some tools like Intellij that have changed now as well.

I'm closing this because I don't think we can take further action.

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

No branches or pull requests

2 participants