Skip to content

Commit 18f8e3c

Browse files
authored
Merge branch 'source' into source
2 parents 0da8209 + 4cce303 commit 18f8e3c

28 files changed

+218
-90
lines changed

site/CNAME

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

site/blog/20160502-rest-api-graphql-wrapper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ However, as we mentioned before, this architecture features some inherent perfor
198198
Take the next 10 minutes to watch me build a server side version of the GraphQL wrapper above using Node and Express.
199199

200200
<iframe id="ytplayer" type="text/html" width="640" height="390"
201-
src="http://github.com/%3Cspan%20class="pl-corl">http://www.youtube.com/embed/UBGzsb2UkeY?autoplay=0&origin=http://graphql.org&start=900"
201+
src="http://github.com/%3Cspan%20class="pl-corl">https://www.youtube.com/embed/UBGzsb2UkeY?autoplay=0&origin=http://graphql.org&start=900"
202202
frameborder="0"></iframe>
203203

204204
## Bonus round: A truly Relay compliant schema

site/code/index.html.js

Lines changed: 65 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 Server 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,18 @@ 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.
474+
- [Grafoo](https://github.com/grafoojs/grafoo): An all purpose GraphQL client with view layer integrations for multiple frameworks in just 1.6kb.
419475
420476
### Swift / Objective-C iOS
421477
@@ -425,12 +481,15 @@ Executor.execute(schema, query) map println
425481
### Python
426482
427483
- [GQL](https://github.com/graphql-python/gql): A GraphQL client in Python.
484+
- [python-graphql-client](https://github.com/graphcool/python-graphql-client): Simple GraphQL client for Python 2.7+.
485+
- [sgqlc](https://github.com/profusion/sgqlc): A simple Python GraphQL client. Supports generating code generation for types defined in a GraphQL schema.
428486
429487
## Tools
430488
431489
- [graphiql](https://github.com/graphql/graphiql) ([npm](https://www.npmjs.com/package/graphiql)): An interactive in-browser GraphQL IDE.
432490
- [libgraphqlparser](https://github.com/graphql/libgraphqlparser): A GraphQL query language parser in C++ with C and C++ APIs.
433491
- [Graphql Language Service](https://github.com/graphql/graphql-language-service): An interface for building GraphQL language services for IDEs (diagnostics, autocomplete etc).
492+
- [quicktype](https://quicktype.io) ([github](https://github.com/quicktype/quicktype)): Generate types for GraphQL queries in TypeScript, Swift, golang, C#, C++, and more.
434493
435494
## Services
436495
@@ -441,6 +500,7 @@ Executor.execute(schema, query) map println
441500
- [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.
442501
- [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.
443502
- [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.
503+
- [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.
444504
445505
## More Stuff
446506

site/community/Community-Events.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@ sublinks: Upcoming Events,Meetups
88

99
## Upcoming Events
1010

11-
### GraphQL Day
12-
13-
- **Date:** April 14, 2018
14-
- **Location:** Amsterdam, The Netherlands
15-
- **Link:** https://www.graphqlday.org/
16-
17-
GraphQL Day is a hands-on developer conference (including an extensive practical workshop) for lovers of GraphQL. GraphQL Day is part of the [GraphQL Europe](https://graphql-europe.org) family.
18-
1911
### GraphQL Europe Conference
2012

2113
- **Date:** June 15, 2018
2214
- **Location:** Berlin, Germany
2315
- **Link:** https://graphql-europe.org
2416

25-
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. **The [CfP](https://www.papercall.io/graphql-eu) is open until March 31**.
17+
### GraphQL Conf
18+
19+
- **Date:** June 20-21, 2019
20+
- **Location:** Berlin, Germany
21+
- **Link:** https://www.graphqlconf.org/
22+
23+
GraphQL Conf 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.
2624

2725
## Meetups
2826

@@ -35,7 +33,6 @@ GraphQL Europe is a non-profit GraphQL conference in Europe with speakers from a
3533
- [GraphQL NYC](https://www.meetup.com/GraphQL-NYC/)
3634
- [GraphQL Atlanta](https://www.meetup.com/GraphQL-Atlanta/)
3735
- [GraphQL Austin](https://www.meetup.com/ATX-GraphQL/)
38-
- [GraphQL Miami](https://www.meetup.com/Miami-GraphQL/)
3936
- [GraphQL Los Angeles](https://www.meetup.com/Los-Angeles-GraphQL-Meetup/)
4037
- [GraphQL Dallas-Fort Worth](https://www.meetup.com/DFW-GraphQL-Meetup/)
4138
- [GraphQL Ottawa](https://www.meetup.com/GraphQL-Ottawa/)
@@ -54,7 +51,6 @@ GraphQL Europe is a non-profit GraphQL conference in Europe with speakers from a
5451

5552
- [GraphQL Amsterdam](https://www.meetup.com/Amsterdam-GraphQL-Meetup/)
5653
- [GraphQL Berlin](https://www.meetup.com/graphql-berlin/)
57-
- [GraphQL Istanbul](https://www.meetup.com/GraphQL-Istanbul/)
5854
- [GraphQL London](https://www.meetup.com/GraphQL-London)
5955
- [GraphQL Paris](https://www.meetup.com/GraphQL-Paris/)
6056
- [GraphQL Munich](https://www.meetup.com/GraphQL-Munich/)
@@ -67,7 +63,7 @@ GraphQL Europe is a non-profit GraphQL conference in Europe with speakers from a
6763
### Australia
6864

6965
- [GraphQL Melbourne](http://graphql.melbourne/)
70-
- [GraphQL Sydney](http://graphql.sydney/)
66+
- [GraphQL Sydney](https://graphql.sydney/)
7167

7268
### Asia
7369

site/community/Community-Resources.md

Lines changed: 9 additions & 3 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,9 +55,9 @@ 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
60-
- [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
60+
- [Tutorial: Kick start a JS API with Apollo-server, Dataloader and Knex](https://bamtech.gitbook.io/dev-standards/backend/graphql-js/getting-started-with-apollo-server-dataloader-knex.mo) - Thomas Pucci
6161
- [Tutorial: How to Build a GraphQL Server](https://medium.com/apollo-stack/tutorial-building-a-graphql-server-cddaa023c035#.bu6sdnst4) - Jonas Helfer
6262
- [Designing Powerful APIs with GraphQL Query Parameters](https://www.graph.cool/docs/tutorials/designing-powerful-apis-with-graphql-query-parameters-aing7uech3/) - Johannes Schickling
6363
- [GraphQL and the amazing Apollo Client](https://medium.com/google-developer-experts/graphql-and-the-amazing-apollo-client-fe57e162a70c) - Gerard Sans
@@ -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.

0 commit comments

Comments
 (0)