Skip to content

Reusing existing data classes in GraphQL Client #822

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

You must be logged in to vote

In general, GraphQL clients will always generate the data classes based on the queries + schema as that ensures type safety of the generated model and also clients only get the data model that corresponds to their queries. Auto generated code for graphql-kotlin-client cannot use any of the your existing data models.

GraphQL request consists of three fields -> query String, operationName String (optional) and variables map of anything so technically you can just POST a request with those fields and marshall the response back using your data models.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by smyrick
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
Converted from issue

This discussion was converted from issue #822 on September 03, 2020 19:40.