Skip to content

Commit f9d308e

Browse files
committed
raw strings
1 parent 89bcda6 commit f9d308e

8 files changed

Lines changed: 848 additions & 780 deletions

File tree

docs/configuration.md

Lines changed: 87 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public class UserContext: Dictionary<string, object?>
326326
public readonly DbContext2 DbContext2;
327327
}
328328
```
329-
<sup><a href='/src/Tests/MultiContextTests/MultiContextTests.cs#L79-L91' title='Snippet source file'>snippet source</a> | <a href='#snippet-multiusercontext' title='Start of snippet'>anchor</a></sup>
329+
<sup><a href='/src/Tests/MultiContextTests/MultiContextTests.cs#L80-L92' title='Snippet source file'>snippet source</a> | <a href='#snippet-multiusercontext' title='Start of snippet'>anchor</a></sup>
330330
<!-- endSnippet -->
331331

332332

@@ -344,7 +344,7 @@ EfGraphQLConventions.RegisterInContainer(
344344
services,
345345
userContext => ((UserContext) userContext).DbContext2);
346346
```
347-
<sup><a href='/src/Tests/MultiContextTests/MultiContextTests.cs#L48-L57' title='Snippet source file'>snippet source</a> | <a href='#snippet-registermultipleincontainer' title='Start of snippet'>anchor</a></sup>
347+
<sup><a href='/src/Tests/MultiContextTests/MultiContextTests.cs#L49-L58' title='Snippet source file'>snippet source</a> | <a href='#snippet-registermultipleincontainer' title='Start of snippet'>anchor</a></sup>
348348
<!-- endSnippet -->
349349

350350

@@ -363,7 +363,7 @@ var executionOptions = new ExecutionOptions
363363
UserContext = new UserContext(dbContext1, dbContext2)
364364
};
365365
```
366-
<sup><a href='/src/Tests/MultiContextTests/MultiContextTests.cs#L63-L72' title='Snippet source file'>snippet source</a> | <a href='#snippet-multiexecutionoptions' title='Start of snippet'>anchor</a></sup>
366+
<sup><a href='/src/Tests/MultiContextTests/MultiContextTests.cs#L64-L73' title='Snippet source file'>snippet source</a> | <a href='#snippet-multiexecutionoptions' title='Start of snippet'>anchor</a></sup>
367367
<!-- endSnippet -->
368368

369369

@@ -454,13 +454,14 @@ public class GraphQlControllerTests
454454
[Fact]
455455
public async Task Get()
456456
{
457-
var query = @"
458-
{
459-
companies
460-
{
461-
id
462-
}
463-
}";
457+
var query = """
458+
{
459+
companies
460+
{
461+
id
462+
}
463+
}
464+
""";
464465
using var response = await clientQueryExecutor.ExecuteGet(client, query);
465466
response.EnsureSuccessStatusCode();
466467
await Verify(await response.Content.ReadAsStringAsync());
@@ -469,13 +470,14 @@ public class GraphQlControllerTests
469470
[Fact]
470471
public async Task Post()
471472
{
472-
var query = @"
473-
{
474-
companies
475-
{
476-
id
477-
}
478-
}";
473+
var query = """
474+
{
475+
companies
476+
{
477+
id
478+
}
479+
}
480+
""";
479481
using var response = await clientQueryExecutor.ExecutePost(client, query);
480482
response.EnsureSuccessStatusCode();
481483
await Verify(await response.Content.ReadAsStringAsync());
@@ -484,14 +486,15 @@ public class GraphQlControllerTests
484486
[Fact]
485487
public async Task Single()
486488
{
487-
var query = @"
488-
query ($id: ID!)
489-
{
490-
company(id:$id)
491-
{
492-
id
493-
}
494-
}";
489+
var query = """
490+
query ($id: ID!)
491+
{
492+
company(id:$id)
493+
{
494+
id
495+
}
496+
}
497+
""";
495498
var variables = new
496499
{
497500
id = "1"
@@ -505,14 +508,15 @@ query ($id: ID!)
505508
[Fact]
506509
public async Task Single_not_found()
507510
{
508-
var query = @"
509-
query ($id: ID!)
510-
{
511-
company(id:$id)
512-
{
513-
id
514-
}
515-
}";
511+
var query = """
512+
query ($id: ID!)
513+
{
514+
company(id:$id)
515+
{
516+
id
517+
}
518+
}
519+
""";
516520
var variables = new
517521
{
518522
id = "99"
@@ -526,14 +530,15 @@ query ($id: ID!)
526530
[Fact]
527531
public async Task Variable()
528532
{
529-
var query = @"
530-
query ($id: ID!)
531-
{
532-
companies(ids:[$id])
533-
{
534-
id
535-
}
536-
}";
533+
var query = """
534+
query ($id: ID!)
535+
{
536+
companies(ids:[$id])
537+
{
538+
id
539+
}
540+
}
541+
""";
537542
var variables = new
538543
{
539544
id = "1"
@@ -548,21 +553,22 @@ query ($id: ID!)
548553
public async Task Companies_paging()
549554
{
550555
var after = 1;
551-
var query = @"
552-
query {
553-
companiesConnection(first:2, after:""" + after + @""") {
554-
edges {
555-
cursor
556-
node {
557-
id
558-
}
559-
}
560-
pageInfo {
561-
endCursor
562-
hasNextPage
563-
}
564-
}
565-
}";
556+
var query = $$"""
557+
query {
558+
companiesConnection(first:2, after:"{{after}}") {
559+
edges {
560+
cursor
561+
node {
562+
id
563+
}
564+
}
565+
pageInfo {
566+
endCursor
567+
hasNextPage
568+
}
569+
}
570+
}
571+
""";
566572
using var response = await clientQueryExecutor.ExecuteGet(client, query);
567573
response.EnsureSuccessStatusCode();
568574
await Verify(await response.Content.ReadAsStringAsync());
@@ -571,13 +577,14 @@ query {
571577
[Fact]
572578
public async Task Employee_summary()
573579
{
574-
var query = @"
575-
query {
576-
employeeSummary {
577-
companyId
578-
averageAge
579-
}
580-
}";
580+
var query = """
581+
query {
582+
employeeSummary {
583+
companyId
584+
averageAge
585+
}
586+
}
587+
""";
581588
using var response = await clientQueryExecutor.ExecuteGet(client, query);
582589
response.EnsureSuccessStatusCode();
583590
await Verify(await response.Content.ReadAsStringAsync());
@@ -586,21 +593,22 @@ query {
586593
[Fact]
587594
public async Task Complex_query_result()
588595
{
589-
var query = @"
590-
query {
591-
employees (
592-
where: [
593-
{groupedExpressions: [
594-
{path: ""content"", comparison: contains, value: ""4"", connector: or},
595-
596-
{ path: ""content"", comparison: contains, value: ""2""}
597-
], connector: and},
598-
{path: ""age"", comparison: greaterThanOrEqual, value: ""31""}
599-
]
600-
) {
601-
id
602-
}
603-
}";
596+
var query = """
597+
query {
598+
employees (
599+
where: [
600+
{groupedExpressions: [
601+
{path: "content", comparison: contains, value: "4", connector: or},
602+
603+
{ path: "content", comparison: contains, value: "2"}
604+
], connector: and},
605+
{path: "age", comparison: greaterThanOrEqual, value: "31"}
606+
]
607+
) {
608+
id
609+
}
610+
}
611+
""";
604612
using var response = await clientQueryExecutor.ExecuteGet(client, query);
605613
var result = await response.Content.ReadAsStringAsync();
606614
response.EnsureSuccessStatusCode();
@@ -615,7 +623,7 @@ query {
615623
}
616624
}
617625
```
618-
<sup><a href='/src/SampleWeb.Tests/GraphQlControllerTests.cs#L4-L191' title='Snippet source file'>snippet source</a> | <a href='#snippet-graphqlcontrollertests' title='Start of snippet'>anchor</a></sup>
626+
<sup><a href='/src/SampleWeb.Tests/GraphQlControllerTests.cs#L4-L199' title='Snippet source file'>snippet source</a> | <a href='#snippet-graphqlcontrollertests' title='Start of snippet'>anchor</a></sup>
619627
<!-- endSnippet -->
620628

621629

0 commit comments

Comments
 (0)