2
                    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
  • 30,841
  • 27
  • 92
  • 100
JaeWang Lee
  • 199
  • 1
  • 11
  • Please see https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/ – Alex Oct 14 '18 at 14:21

1 Answers1

5

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
  • 17,448
  • 11
  • 60
  • 79