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

Add support for C# constants #110

Merged
merged 2 commits into from
Jun 23, 2024
Merged

Add support for C# constants #110

merged 2 commits into from
Jun 23, 2024

Conversation

byme8
Copy link
Owner

@byme8 byme8 commented Jun 23, 2024

You can create constant variables in C#. If you pass it in the GraphQL lambda it would correct C# syntax but the query will fail in runtime.

This PR adds support for constant by embedding their value into the GraphQL query itself. here example:

const string firstName = "John";
const string lastName = "Smith";
var response = await qlClient.Mutation(m => m.AddUser(firstName, lastName, o => o.Id));
// mutation { addUser(firstName: "John", lastName: "Smith") { id } }                    

Fixes #108

@byme8 byme8 merged commit aeab6b4 into main Jun 23, 2024
@byme8 byme8 deleted the feature/constants branch June 23, 2024 09:37
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.

Using const strings instead of strings for mutation variables fails
1 participant