-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #184 from graphql-dotnet/develop
Release v2.1.1
- Loading branch information
Showing
49 changed files
with
1,325 additions
and
971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: Branch workflow | ||
on: | ||
on: | ||
push: | ||
branches-ignore: | ||
- '**' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.idea/ | ||
.vs/ | ||
.vscode/ | ||
bin/ | ||
obj/ | ||
*.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace GraphQL.Client.Http.Examples | ||
{ | ||
public class PersonAndFilmsResponse { | ||
public PersonContent Person { get; set; } | ||
|
||
public class PersonContent { | ||
public string Name { get; set; } | ||
public FilmConnectionContent FilmConnection { get; set; } | ||
|
||
public class FilmConnectionContent { | ||
public List<FilmContent> Films { get; set; } | ||
|
||
public class FilmContent { | ||
public string Title { get; set; } | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Text.Json; | ||
using System.Threading.Tasks; | ||
using GraphQL.Client.Serializer.Newtonsoft; | ||
|
||
namespace GraphQL.Client.Http.Examples { | ||
|
||
public class Program { | ||
|
||
public static async Task Main(string[] args) { | ||
|
||
using var graphQLClient = new GraphQLHttpClient("https://swapi.apis.guru/"); | ||
|
||
var personAndFilmsRequest = new GraphQLRequest { | ||
Query = @" | ||
query PersonAndFilms($id: ID) { | ||
person(id: $id) { | ||
name | ||
filmConnection { | ||
films { | ||
title | ||
} | ||
} | ||
} | ||
}", | ||
OperationName = "PersonAndFilms", | ||
Variables = new { | ||
id = "cGVvcGxlOjE=" | ||
} | ||
}; | ||
|
||
var graphQLResponse = await graphQLClient.SendQueryAsync<PersonAndFilmsResponse>(personAndFilmsRequest); | ||
Console.WriteLine("raw response:"); | ||
Console.WriteLine(JsonSerializer.Serialize(graphQLResponse, new JsonSerializerOptions { WriteIndented = true })); | ||
|
||
Console.WriteLine(); | ||
Console.WriteLine($"Name: {graphQLResponse.Data.Person.Name}" ); | ||
var films = string.Join(", ", graphQLResponse.Data.Person.FilmConnection.Films.Select(f => f.Title)); | ||
Console.WriteLine($"Films: {films}"); | ||
|
||
Console.WriteLine(); | ||
Console.WriteLine("Press any key to quit..."); | ||
Console.ReadKey(); | ||
} | ||
|
||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.