1
                    var request = new GraphQLRequest
                {
                    Query = @"
mutation {
  login(email: "{email}", password: "{password}") {
    userId,
    accessToken
  }
}"
                };

I am coding with GraphQL with C#

I want to insert "{email}" and "{password}" in string, But above code is not work properly :(

How I solve this..? Please help me

Machavity
  • 29,816
  • 26
  • 86
  • 96
JaeWang Lee
  • 189
  • 1
  • 10
  • Please see https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/ – Alex Oct 14 '18 at 14:21

1 Answers1

3

You can combine @ and $, like this: $@"Hi {username}!"

var somevalue = "your value";
//note: SO's code formatting is a bit off here
var str = $@"Hi
    This is, {somevalue} 
    and more";

See this fiddle.

Note: the order, $@ is crucial.

Stefan
  • 16,235
  • 9
  • 55
  • 74