graphql-dotnet / graphql-dotnet/graphql-client

Request to add API that returns string responses/errors rather than deserialized results

Open
#139 25 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
648
Forks
136
PR merge metrics
No merged PRs in 30d

Description

This will help in making the library usable with il2cpp/no dynamics/WebGL based use cases including Unity which is a big community. The consumer of the API can perform the deserialized operation on their side as needed with any compatible package.

A small addition to the source code at my end was enough to get the responses to work nicely-
`public Task SendQueryAsync(GraphQLRequest request, CancellationToken cancellationToken = default) =>
this.graphQLHttpHandler.PostAsync(request, cancellationToken);`

il2cpp successful results in Unity-
![image](https://user-images.githubusercontent.com/18451476/68371919-99c3fd00-00f4-11ea-9ad9-6c67fe3f73bc.png)

@deinok Please let me know what you think about this? I feel it can be very useful to increase the scope of use. Serialization does not have any issues currently with il2cpp once newton json is configured to turn off dynamics and works out of the box as expected. But deserialization does not work because of how the graphql response class is set up and dependent on dynamics data. Other idea would be to use some generic JsonConstructor in the graphql response class that prevents dynamics usage.
The version I am using is 'GraphQL.Client.2.0.0-alpha.3'.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.