Skip to content

Generate client based on schema only from graphql-kotlin-maven-plugin -> generate-sdl #1556

Answered by dariuszkuc
AlehGalo asked this question in Q&A
Discussion options

You must be logged in to vote

Hello 👋

There is a major difference between OpenAPI and GraphQL in that in the latter clients decide which fields they want to request (vs server dictating the full response in REST). GraphQL schema file defines the shape of your API and clients need to explicitly provide queries that define which data they want. Thats why you need both schema and query files in order to generate the client.

There is no wildcard support in GraphQL and queries have to be explicit (see this issue), i.e. there is no SELECT * FROM schema SQL equivalent. If your clients always request full schema then I am unsure whether you get much out of GraphQL and OpenAPI might be potentially better suited for your use ca…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@AlehGalo
Comment options

@dariuszkuc
Comment options

Answer selected by AlehGalo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants