Skip to content

Commit e3f2e2b

Browse files
author
Daniel Calle Rosa
authored
Merge branch 'source' into source
2 parents 71f8d8a + e79f699 commit e3f2e2b

26 files changed

+213
-77
lines changed

site/CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

site/code/index.html.js

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ In addition to the GraphQL [reference implementations in JavaScript](#javascript
4242
4343
- [graphql-dotnet](https://github.com/graphql-dotnet/graphql-dotnet): GraphQL for .NET
4444
- [graphql-net](https://github.com/ckimes89/graphql-net): Convert GraphQL to IQueryable
45+
- [Hot Chocolate](https://github.com/ChilliCream/hotchocolate): GraphQL Service for .net core and .net classic
4546
4647
### Clojure
4748
@@ -122,6 +123,8 @@ Code that executes a hello world GraphQL query with \`graphql-clj\`:
122123
- [graphql-go](https://github.com/graphql-go/graphql): An implementation of GraphQL for Go / Golang.
123124
- [graphql-relay-go](https://github.com/graphql-go/relay): A Go/Golang library to help construct a graphql-go server supporting react-relay.
124125
- [neelance/graphql-go](https://github.com/neelance/graphql-go): An active implementation of GraphQL in Golang.
126+
- [machinebox/graphql](https://github.com/machinebox/graphql): An elegant low-level HTTP client for GraphQL.
127+
- [samsarahq/thunder](https://github.com/samsarahq/thunder): A GraphQL implementation with easy schema building, live queries, and batching.
125128
126129
### Groovy
127130
@@ -302,6 +305,47 @@ Apollo Server also supports all Node.js HTTP server frameworks: Express, Connect
302305
- [graphql-php](https://github.com/webonyx/graphql-php): A PHP port of GraphQL reference implementation
303306
- [graphql-relay-php](https://github.com/ivome/graphql-relay-php): A library to help construct a graphql-php server supporting react-relay.
304307
308+
#### [Siler](https://siler.leocavalcante.com/graphql/) ([github](https://github.com/leocavalcante/siler))
309+
310+
Siler is a PHP library powered with high-level abstractions to work with GraphQL.
311+
312+
To run a Siler hello world script:
313+
314+
\`\`\`graphql
315+
type Query {
316+
hello: String
317+
}
318+
\`\`\`
319+
320+
\`\`\`php
321+
<?php
322+
declare(strict_types=1);
323+
require_once '/path/to/vendor/autoload.php';
324+
325+
use Siler\Diactoros;
326+
use Siler\Graphql;
327+
use Siler\Http;
328+
329+
$typeDefs = file_get_contents(__DIR__.'/schema.graphql');
330+
$resolvers = [
331+
'Query' => [
332+
'hello' => 'world',
333+
],
334+
];
335+
$schema = Graphql\schema($typeDefs, $resolvers);
336+
337+
echo "Server running at http://127.0.0.1:8080\n";
338+
Http\server(Graphql\psr7($schema), function (\Throwable $err) {
339+
var_dump($err);
340+
return Diactoros\json([
341+
'error' => true,
342+
'message' => $err->getMessage(),
343+
]);
344+
})()->run();
345+
\`\`\`
346+
347+
It also provides functionality for the construction of a WebSocket Subscriptions Server based on how Apollo works.
348+
305349
### Python
306350
307351
#### [Graphene](http://graphene-python.org/) ([github](https://github.com/graphql-python/graphene))
@@ -320,14 +364,14 @@ Then run \`python hello.py\` with this code in \`hello.py\`:
320364
import graphene
321365
322366
class Query(graphene.ObjectType):
323-
hello = graphene.String()
367+
hello = graphene.String(name=graphene.String(default_value="World"))
324368
325-
def resolve_hello(self, args, context, info):
326-
return 'Hello world!'
369+
def resolve_hello(self, info, name):
370+
return 'Hello ' + name
327371
328372
schema = graphene.Schema(query=Query)
329373
result = schema.execute('{ hello }')
330-
print(result.data['hello'])
374+
print(result.data['hello']) # "Hello World"
331375
\`\`\`
332376
333377
There are also nice bindings for [Relay](https://facebook.github.io/relay/), Django, SQLAlchemy, and Google App Engine.
@@ -361,7 +405,7 @@ Schema = GraphQL::Schema.define do
361405
query QueryType
362406
end
363407
364-
puts Schema.execute('{ hello }')
408+
puts Schema.execute('{ hello }').to_json
365409
\`\`\`
366410
367411
There are also nice bindings for Relay and Rails.
@@ -391,6 +435,7 @@ Executor.execute(schema, query) map println
391435
## GraphQL Clients
392436
393437
- [C# / .NET](#c-net-1)
438+
- [Clojurescript](#clojurescript-1)
394439
- [Go](#go-1)
395440
- [Java / Android](#java-android)
396441
- [JavaScript](#javascript-1)
@@ -399,7 +444,13 @@ Executor.execute(schema, query) map println
399444
400445
### C# / .NET
401446
447+
- [GraphQL.Client](https://github.com/graphql-dotnet/graphql-client): A GraphQL Client for .NET.
402448
- [graphql-net-client](https://github.com/bkniffler/graphql-net-client): Basic example GraphQL client for .NET.
449+
- [SAHB.GraphQLClient](https://github.com/sahb1239/SAHB.GraphQLClient): GraphQL client which supports generating queries from C# classes
450+
451+
### Clojurescript
452+
453+
- [re-graph](https://github.com/oliyh/re-graph/): A GraphQL client implemented in Clojurescript with support for websockets.
403454
404455
### Go
405456
@@ -409,13 +460,17 @@ Executor.execute(schema, query) map println
409460
410461
- [Apollo Android](https://github.com/apollographql/apollo-android): A strongly-typed, caching GraphQL client for Android, written in Java.
411462
463+
- [Nodes](https://github.com/americanexpress/nodes): A GraphQL JVM Client designed for constructing queries from standard model definitions. By American Express.
464+
412465
### JavaScript
413466
414467
- [Relay](https://facebook.github.io/relay/) ([github](https://github.com/facebook/relay)) ([npm](https://www.npmjs.com/package/react-relay)): Facebook's framework for building React applications that talk to a GraphQL backend.
415468
- [Apollo Client](http://apollographql.com/client/) ([github](https://github.com/apollographql/apollo-client)): A powerful JavaScript GraphQL client, designed to work well with React, React Native, Angular 2, or just plain JavaScript.
416469
- [graphql-request](https://github.com/graphcool/graphql-request): A simple and flexible JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native) - basically a lightweight wrapper around \`fetch\`.
417470
- [Lokka](https://github.com/kadirahq/lokka): A simple JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native).
418471
- [nanogql](https://github.com/yoshuawuyts/nanogql): Tiny GraphQL client library using template strings.
472+
- [gq-loader](https://github.com/Houfeng/gq-loader): A simple JavaScript GraphQL client,Let the *.gql file be used as a module through webpack loader.
473+
- [AWS Amplify](https://aws.github.io/aws-amplify): A JavaScript library for application development using cloud services, which supports GraphQL backend and React components for working with GraphQL data.
419474
420475
### Swift / Objective-C iOS
421476
@@ -425,12 +480,15 @@ Executor.execute(schema, query) map println
425480
### Python
426481
427482
- [GQL](https://github.com/graphql-python/gql): A GraphQL client in Python.
483+
- [python-graphql-client](https://github.com/graphcool/python-graphql-client): Simple GraphQL client for Python 2.7+.
484+
- [sgqlc](https://github.com/profusion/sgqlc): A simple Python GraphQL client. Supports generating code generation for types defined in a GraphQL schema.
428485
429486
## Tools
430487
431488
- [graphiql](https://github.com/graphql/graphiql) ([npm](https://www.npmjs.com/package/graphiql)): An interactive in-browser GraphQL IDE.
432489
- [libgraphqlparser](https://github.com/graphql/libgraphqlparser): A GraphQL query language parser in C++ with C and C++ APIs.
433490
- [Graphql Language Service](https://github.com/graphql/graphql-language-service): An interface for building GraphQL language services for IDEs (diagnostics, autocomplete etc).
491+
- [quicktype](https://quicktype.io) ([github](https://github.com/quicktype/quicktype)): Generate types for GraphQL queries in TypeScript, Swift, golang, C#, C++, and more.
434492
435493
## Services
436494
@@ -441,6 +499,7 @@ Executor.execute(schema, query) map println
441499
- [Scaphold](https://scaphold.io) ([github](https://github.com/scaphold-io)): A BaaS (Backend as a Service) that sets you up with a GraphQL backend for your applications with many different integrations.
442500
- [Tipe](https://tipe.io) ([github](https://github.com/tipeio)): A SaaS (Software as a Service) content management system that allows you to create your content with powerful editing tools and access it from anywhere with a GraphQL or REST API.
443501
- [AWS AppSync](https://aws.amazon.com/appsync/): Fully managed GraphQL service with realtime subscriptions, offline programming & synchronization, and enterprise security features as well as fine grained authorization controls.
502+
- [Hasura](https://hasura.io): A BaaS (Backend as a Service) that lets you create tables, define permissions on Postgres and query and manipulate using a GraphQL interface.
444503
445504
## More Stuff
446505

site/community/Community-Events.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ sublinks: Upcoming Events,Meetups
1616

1717
GraphQL Europe is a non-profit GraphQL conference in Europe with speakers from all around the world. Learn about GraphQL best practices from industry experts and become part of the thriving GraphQL community.
1818

19+
### GraphQL Finland Conference
20+
21+
- **Date:** October 18-19, 2018
22+
- **Location:** Helsinki, Finland
23+
- **Link:** https://graphql-finland.fi/
24+
25+
GraphQL Finland is a community-organized GraphQL conference. The first of its kind in Finland, the event consists of a workshop day and a day of talks around the topic. GraphQL Finland is organized by the same team that brought you React Finland.
26+
1927
## Meetups
2028

2129
### North America
@@ -27,7 +35,6 @@ GraphQL Europe is a non-profit GraphQL conference in Europe with speakers from a
2735
- [GraphQL NYC](https://www.meetup.com/GraphQL-NYC/)
2836
- [GraphQL Atlanta](https://www.meetup.com/GraphQL-Atlanta/)
2937
- [GraphQL Austin](https://www.meetup.com/ATX-GraphQL/)
30-
- [GraphQL Miami](https://www.meetup.com/Miami-GraphQL/)
3138
- [GraphQL Los Angeles](https://www.meetup.com/Los-Angeles-GraphQL-Meetup/)
3239
- [GraphQL Dallas-Fort Worth](https://www.meetup.com/DFW-GraphQL-Meetup/)
3340
- [GraphQL Ottawa](https://www.meetup.com/GraphQL-Ottawa/)
@@ -46,7 +53,6 @@ GraphQL Europe is a non-profit GraphQL conference in Europe with speakers from a
4653

4754
- [GraphQL Amsterdam](https://www.meetup.com/Amsterdam-GraphQL-Meetup/)
4855
- [GraphQL Berlin](https://www.meetup.com/graphql-berlin/)
49-
- [GraphQL Istanbul](https://www.meetup.com/GraphQL-Istanbul/)
5056
- [GraphQL London](https://www.meetup.com/GraphQL-London)
5157
- [GraphQL Paris](https://www.meetup.com/GraphQL-Paris/)
5258
- [GraphQL Munich](https://www.meetup.com/GraphQL-Munich/)
@@ -59,7 +65,7 @@ GraphQL Europe is a non-profit GraphQL conference in Europe with speakers from a
5965
### Australia
6066

6167
- [GraphQL Melbourne](http://graphql.melbourne/)
62-
- [GraphQL Sydney](http://graphql.sydney/)
68+
- [GraphQL Sydney](https://graphql.sydney/)
6369

6470
### Asia
6571

site/community/Community-Resources.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Many members of the community use Stack Overflow to ask and answer questions. [R
1313

1414
## Facebook Group
1515

16-
Join the [GraphQL Facebook Group](https://www.facebook.com/groups/graphql.community/) for questions, discussion, and sharing. The GraphQL Facebook group is the preferred venue for announcements and broader discussion.
16+
Join the [GraphQL Facebook Group](https://www.facebook.com/groups/graphql.community/) sharing and discovering new content. The GraphQL Facebook group is the preferred venue for announcements and broader discussion.
1717

1818
## Twitter
1919

@@ -55,7 +55,7 @@ Here are a list of notable blog posts to help you better understand GraphQL:
5555
- [From REST to GraphQL](https://0x2a.sh/from-rest-to-graphql-b4e95e94c26b#.tag7nzkrb) - Jacob Gillespie
5656
- [GraphQL Explained](https://medium.com/apollo-stack/graphql-explained-5844742f195e#.zdykxos6i) - Jonas Helfer
5757
- [GraphQL Concepts Visualized](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.hfczgtdsj) - Dhaivat Pandya
58-
- [Building the f8 App: Using GraphQL & Relay](http://makeitopen.com/tutorials/building-the-f8-app/relay/)
58+
- [Building the f8 App: Using GraphQL & Relay](http://makeitopen.com/docs/en/1-A2-relay.html)
5959
- [Your First GraphQL Server](https://medium.com/the-graphqlhub/your-first-graphql-server-3c766ab4f0a2#.ovn0y19k4) - Clay Allsopp
6060
- [Tutorial: Kick start a JS API with Apollo-server, Dataloader and Knex](https://bamtech.gitbooks.io/dev-standards/content/backend/graphql-js/getting-started-with-apollo-server-dataloader-knex.mo.html) - Thomas Pucci
6161
- [Tutorial: How to Build a GraphQL Server](https://medium.com/apollo-stack/tutorial-building-a-graphql-server-cddaa023c035#.bu6sdnst4) - Jonas Helfer
@@ -92,9 +92,15 @@ Developers inside and outside of Facebook have given talks about GraphQL at conf
9292
- [Unleashing the power of GraphQL using Angular 2](https://www.youtube.com/watch?v=VYpJ9pfugM8) - Gerard Sans, NG-BE 2016
9393
- [Webinar Series: GraphQL Around The World](https://graphql-world.com/webinar) - Vince Ning & Michael Paris
9494
- [All Talks from GraphQL Europe](https://www.youtube.com/playlist?list=PLn2e1F9Rfr6n_WFm9fPE-_wYPrYvSTySt) - Lee Byron, Sashko Stubailo, Dan Schafer, Johannes Schickling and many more
95+
- [Learning GraphQL with React and Relay](https://www.packtpub.com/application-development/learning-graphql-react-and-relay-video) by Divyendu Singh
96+
- [Hands-on GraphQL for Better RESTful Web Services (Video)](https://www.packtpub.com/application-development/hands-graphql-better-restful-web-services-video) by Ashwin Hegde
9597

9698
## Books
9799

100+
- [The GraphQL Guide](https://graphql.guide) by John Resig and Loren Sands-Ramshaw
101+
- [Learning GraphQL](https://www.amazon.com/Learning-GraphQL-Declarative-Fetching-Modern/dp/1492030716/) by Eve Porcello and Alex Banks
102+
- [Fullstack GraphQL](https://www.graphql.college/fullstack-graphql) by Julian Mayorga
103+
- [Craft GraphQL APIs in Elixir with Absinthe](https://pragprog.com/book/wwgraphql/craft-graphql-apis-in-elixir-with-absinthe) by Bruce Williams and Ben Wilson
98104
- [Learning GraphQL and Relay](https://www.packtpub.com/web-development/learning-graphql-and-relay) by Samer Buna
99105

100106
## More Resources

site/graphql-js/APIReference-Errors.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ class GraphQLError extends Error {
5555
nodes?: Array<any>,
5656
stack?: ?string,
5757
source?: Source,
58-
positions?: Array<number>
58+
positions?: Array<number>,
59+
originalError?: ?Error,
60+
extensions?: ?{ [key: string]: mixed }
5961
)
6062
}
6163
```

site/graphql-js/APIReference-Execution.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export function execute(
3838
contextValue?: mixed,
3939
variableValues?: ?{[key: string]: mixed},
4040
operationName?: ?string
41-
): Promise<ExecutionResult>
41+
): MaybePromise<ExecutionResult>
42+
43+
type MaybePromise<T> = Promise<T> | T;
4244

4345
type ExecutionResult = {
4446
data: ?Object;

site/graphql-js/APIReference-TypeSystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ var RGBType = new GraphQLEnumType({
461461
462462
```js
463463
class GraphQLInputObjectType {
464-
constructor(config: GraphQLInputObjectTypeConfig)
464+
constructor(config: GraphQLInputObjectConfig)
465465
}
466466

467467
type GraphQLInputObjectConfig = {

site/graphql-js/APIReference-Utilities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var { introspectionQuery } = require('graphql'); // CommonJS
5252
<li>
5353
<a href="#printintrospectionschema">
5454
<pre>function printIntrospectionSchema</pre>
55-
Prints the introspections featurs of the schema in a standard format.
55+
Prints the introspection features of the schema in a standard format.
5656
</a>
5757
</li>
5858
<li>

site/graphql-js/Tutorial-GraphQLClients.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,21 @@ You should see the output returned as JSON:
2323
{"data":{"hello":"Hello world!"}}
2424
```
2525

26+
If you prefer to use a graphical user interface to send a test query, you can use clients such as [GraphiQL](https://github.com/graphql/graphiql) and [Insomnia](https://github.com/getinsomnia/insomnia).
27+
2628
It's also simple to send GraphQL from the browser. Open up http://localhost:4000, open a developer console, and paste in:
2729

2830
```javascript
29-
var xhr = new XMLHttpRequest();
30-
xhr.responseType = 'json';
31-
xhr.open("POST", "/graphql");
32-
xhr.setRequestHeader("Content-Type", "application/json");
33-
xhr.setRequestHeader("Accept", "application/json");
34-
xhr.onload = function () {
35-
console.log('data returned:', xhr.response);
36-
}
37-
xhr.send(JSON.stringify({query: "{ hello }"}));
31+
fetch('/graphql', {
32+
method: 'POST',
33+
headers: {
34+
'Content-Type': 'application/json',
35+
'Accept': 'application/json',
36+
},
37+
body: JSON.stringify({query: "{ hello }"})
38+
})
39+
.then(r => r.json())
40+
.then(data => console.log('data returned:', data));
3841
```
3942

4043
You should see the data returned, logged in the console:
@@ -58,21 +61,23 @@ You could access this from JavaScript with the code:
5861
```javascript
5962
var dice = 3;
6063
var sides = 6;
61-
var xhr = new XMLHttpRequest();
62-
xhr.responseType = 'json';
63-
xhr.open("POST", "/graphql");
64-
xhr.setRequestHeader("Content-Type", "application/json");
65-
xhr.setRequestHeader("Accept", "application/json");
66-
xhr.onload = function () {
67-
console.log('data returned:', xhr.response);
68-
}
6964
var query = `query RollDice($dice: Int!, $sides: Int) {
7065
rollDice(numDice: $dice, numSides: $sides)
7166
}`;
72-
xhr.send(JSON.stringify({
73-
query: query,
74-
variables: { dice: dice, sides: sides },
75-
}));
67+
68+
fetch('/graphql', {
69+
method: 'POST',
70+
headers: {
71+
'Content-Type': 'application/json',
72+
'Accept': 'application/json',
73+
},
74+
body: JSON.stringify({
75+
query,
76+
variables: { dice, sides },
77+
})
78+
})
79+
.then(r => r.json())
80+
.then(data => console.log('data returned:', data));
7681
```
7782

7883
Using this syntax for variables is a good idea because it automatically prevents bugs due to escaping, and it makes it easier to monitor your server.

site/graphql-js/Tutorial-Mutations.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,28 +165,30 @@ You can use variables to simplify mutation client logic just like you can with q
165165
```javascript
166166
var author = 'andy';
167167
var content = 'hope is a good thing';
168-
var xhr = new XMLHttpRequest();
169-
xhr.responseType = 'json';
170-
xhr.open("POST", "/graphql");
171-
xhr.setRequestHeader("Content-Type", "application/json");
172-
xhr.setRequestHeader("Accept", "application/json");
173-
xhr.onload = function () {
174-
console.log('data returned:', xhr.response);
175-
}
176168
var query = `mutation CreateMessage($input: MessageInput) {
177169
createMessage(input: $input) {
178170
id
179171
}
180172
}`;
181-
xhr.send(JSON.stringify({
182-
query: query,
183-
variables: {
184-
input: {
185-
author: author,
186-
content: content,
173+
174+
fetch('/graphql', {
175+
method: 'POST',
176+
headers: {
177+
'Content-Type': 'application/json',
178+
'Accept': 'application/json',
179+
},
180+
body: JSON.stringify({
181+
query,
182+
variables: {
183+
input: {
184+
author,
185+
content,
186+
}
187187
}
188-
}
189-
}));
188+
})
189+
})
190+
.then(r => r.json())
191+
.then(data => console.log('data returned:', data));
190192
```
191193

192194
One particular type of mutation is operations that change users, like signing up a new user. While you can implement this using GraphQL mutations, you can reuse many existing libraries if you learn about [GraphQL with authentication and Express middleware](/graphql-js/authentication-and-express-middleware/).

0 commit comments

Comments
 (0)