Skip to content

Commit 2af274c

Browse files
committed
Order languages alphabetically on /code
This puts the language sections in order as suggested in: graphql#332 Additionally, it adds small tables of contents at the top of each major section to make it easier to locate and jump to specific language implementations. I maintained a special call-out to the JavaScript reference implementations because we want them to be fairly prominent (this is why they were at the top in originally). Manually tested that the links work by running a local build. Note that there is some fragility here in that the links are hand-constructed and depend on the ordering within the page (ie. the server JavaScript link it "#javascript" but the client one is "#javascript-1" because it appears further down the page); wanted to do the simplest thing for now and deal with any breakage later IFF it ever happens.
1 parent 021ac47 commit 2af274c

File tree

1 file changed

+183
-165
lines changed

1 file changed

+183
-165
lines changed

site/code/index.html.js

Lines changed: 183 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,146 @@ Many different programming languages support GraphQL. This list contains some of
2323
2424
## Server Libraries
2525
26+
In addition to the GraphQL [reference implementations in JavaScript](#javascript), server libraries include:
27+
28+
- [C# / .NET](#c-net)
29+
- [Clojure](#clojure)
30+
- [Elixir](#elixir)
31+
- [Erlang](#erlang)
32+
- [Go](#go)
33+
- [Java](#java)
34+
- [JavaScript](#javascript)
35+
- [PHP](#php)
36+
- [Python](#python)
37+
- [Scala](#scala)
38+
- [Ruby](#ruby)
39+
40+
### C# / .NET
41+
42+
- [graphql-dotnet](https://github.com/graphql-dotnet/graphql-dotnet): GraphQL for .NET
43+
- [graphql-net](https://github.com/ckimes89/graphql-net): Convert GraphQL to IQueryable
44+
45+
### Clojure
46+
47+
#### [alumbra](https://github.com/alumbra/alumbra)
48+
49+
A set of reusable GraphQL components for Clojure conforming to the data structures given in [alumbra.spec](https://github.com/alumbra/alumbra.spec).
50+
51+
\`\`\`clojure
52+
(require '[alumbra.core :as alumbra]
53+
'[claro.data :as data])
54+
55+
(def schema
56+
"type Person { name: String!, friends: [Person!]! }
57+
type QueryRoot { person(id: ID!): Person, me: Person! }
58+
schema { query: QueryRoot }")
59+
60+
(defrecord Person [id]
61+
data/Resolvable
62+
(resolve! [_ _]
63+
{:name (str "Person #" id)
64+
:friends (map ->Person (range (inc id) (+ id 3)))}))
65+
66+
(def QueryRoot
67+
{:person (map->Person {})
68+
:me (map->Person {:id 0})})
69+
70+
(def app
71+
(alumbra/handler
72+
{:schema schema
73+
:query QueryRoot}))
74+
75+
(defonce my-graphql-server
76+
(aleph.http/start-server #'app {:port 3000}))
77+
\`\`\`
78+
79+
\`\`\`bash
80+
$ curl -XPOST "http://0:3000" -H'Content-Type: application/json' -d'{
81+
"query": "{ me { name, friends { name } } }"
82+
}'
83+
{"data":{"me":{"name":"Person #0","friends":[{"name":"Person #1"},{"name":"Person #2"}]}}}
84+
\`\`\`
85+
86+
#### [graphql-clj](https://github.com/tendant/graphql-clj)
87+
88+
A Clojure library that provides a GraphQL implementation.
89+
90+
Code that executes a hello world GraphQL query with \`graphql-clj\`:
91+
92+
\`\`\`clojure
93+
94+
(def schema "type QueryRoot {
95+
hello: String
96+
}")
97+
98+
(defn resolver-fn [type-name field-name]
99+
(get-in {"QueryRoot" {"hello" (fn [context parent & rest]
100+
"Hello world!")}}
101+
[type-name field-name]))
102+
103+
(require '[graphql-clj.executor :as executor])
104+
105+
(executor/execute nil schema resolver-fn "{ hello }")
106+
\`\`\`
107+
108+
- [lacinia](https://github.com/walmartlabs/lacinia): A full implementation of the GraphQL specification that aims to maintain external compliance with the specification.
109+
110+
### Elixir
111+
112+
- [absinthe](https://github.com/absinthe-graphql/absinthe): GraphQL implementation for Elixir.
113+
- [graphql-elixir](https://github.com/graphql-elixir/graphql): An Elixir implementation of Facebook's GraphQL.
114+
115+
### Erlang
116+
117+
- [graphql-erlang](https://github.com/shopgun/graphql-erlang): GraphQL implementation in Erlang.
118+
119+
### Go
120+
121+
- [graphql-go](https://github.com/graphql-go/graphql): An implementation of GraphQL for Go / Golang.
122+
- [graphql-relay-go](https://github.com/graphql-go/relay): A Go/Golang library to help construct a graphql-go server supporting react-relay.
123+
- [neelance/graphql-go](https://github.com/neelance/graphql-go): An active implementation of GraphQL in Golang.
124+
125+
### Java
126+
127+
#### [graphql-java](https://github.com/graphql-java/graphql-java)
128+
129+
A Java library for building GraphQL APIs.
130+
131+
Code that executes a hello world GraphQL query with \`graphql-java\`:
132+
133+
\`\`\`java
134+
import graphql.schema.GraphQLObjectType;
135+
import graphql.schema.GraphQLSchema;
136+
137+
import static graphql.Scalars.GraphQLString;
138+
import static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;
139+
import static graphql.schema.GraphQLObjectType.newObject;
140+
141+
public class HelloWorld {
142+
143+
public static void main(String[] args) {
144+
145+
GraphQLObjectType queryType = newObject()
146+
.name("helloWorldQuery")
147+
.field(newFieldDefinition()
148+
.type(GraphQLString)
149+
.name("hello")
150+
.staticValue("world"))
151+
.build();
152+
153+
GraphQLSchema schema = GraphQLSchema.newSchema()
154+
.query(queryType)
155+
.build();
156+
Map<String, Object> result = new GraphQL(schema).execute("{hello}").getData();
157+
158+
System.out.println(result);
159+
// Prints: {hello=world}
160+
}
161+
}
162+
\`\`\`
163+
164+
See [the graphql-java docs](https://github.com/graphql-java/graphql-java) for more information on setup.
165+
26166
### JavaScript
27167
28168
#### [GraphQL.js](/graphql-js/) ([github](https://github.com/graphql/graphql-js/)) ([npm](https://www.npmjs.com/package/graphql))
@@ -131,6 +271,41 @@ app.listen(4000, () => console.log('Now browse to localhost:4000/graphiql'));
131271
132272
GraphQL Server also supports all Node.js HTTP server frameworks: Express, Connect, HAPI and Koa.
133273
274+
### PHP
275+
276+
- [graphql-php](https://github.com/webonyx/graphql-php): A PHP port of GraphQL reference implementation
277+
- [graphql-relay-php](https://github.com/ivome/graphql-relay-php): A library to help construct a graphql-php server supporting react-relay.
278+
279+
### Python
280+
281+
#### [Graphene](http://graphene-python.org/) ([github](https://github.com/graphql-python/graphene))
282+
283+
A Python library for building GraphQL APIs.
284+
285+
To run a Graphene hello world script:
286+
287+
\`\`\`bash
288+
pip install graphene
289+
\`\`\`
290+
291+
Then run \`python hello.py\` with this code in \`hello.py\`:
292+
293+
\`\`\`python
294+
import graphene
295+
296+
class Query(graphene.ObjectType):
297+
hello = graphene.String()
298+
299+
def resolve_hello(self, args, context, info):
300+
return 'Hello world!'
301+
302+
schema = graphene.Schema(query=Query)
303+
result = schema.execute('{ hello }')
304+
print(result.data['hello'])
305+
\`\`\`
306+
307+
There are also nice bindings for [Relay](https://facebook.github.io/relay/), Django, SQLAlchemy, and Google App Engine.
308+
134309
### Ruby
135310
136311
#### [graphql-ruby](https://github.com/rmosolgo/graphql-ruby)
@@ -165,36 +340,6 @@ puts Schema.execute('{ hello }')
165340
166341
There are also nice bindings for Relay and Rails.
167342
168-
### Python
169-
170-
#### [Graphene](http://graphene-python.org/) ([github](https://github.com/graphql-python/graphene))
171-
172-
A Python library for building GraphQL APIs.
173-
174-
To run a Graphene hello world script:
175-
176-
\`\`\`bash
177-
pip install graphene
178-
\`\`\`
179-
180-
Then run \`python hello.py\` with this code in \`hello.py\`:
181-
182-
\`\`\`python
183-
import graphene
184-
185-
class Query(graphene.ObjectType):
186-
hello = graphene.String()
187-
188-
def resolve_hello(self, args, context, info):
189-
return 'Hello world!'
190-
191-
schema = graphene.Schema(query=Query)
192-
result = schema.execute('{ hello }')
193-
print(result.data['hello'])
194-
\`\`\`
195-
196-
There are also nice bindings for [Relay](https://facebook.github.io/relay/), Django, SQLAlchemy, and Google App Engine.
197-
198343
### Scala
199344
200345
#### [Sangria](http://sangria-graphql.org/) ([github](https://github.com/sangria-graphql/sangria)): A Scala GraphQL library that supports [Relay](https://facebook.github.io/relay/).
@@ -217,138 +362,20 @@ val query = graphql"{ hello }"
217362
Executor.execute(schema, query) map println
218363
\`\`\`
219364
220-
### Java
221-
222-
#### [graphql-java](https://github.com/graphql-java/graphql-java)
223-
224-
A Java library for building GraphQL APIs.
225-
226-
Code that executes a hello world GraphQL query with \`graphql-java\`:
227-
228-
\`\`\`java
229-
import graphql.schema.GraphQLObjectType;
230-
import graphql.schema.GraphQLSchema;
231-
232-
import static graphql.Scalars.GraphQLString;
233-
import static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;
234-
import static graphql.schema.GraphQLObjectType.newObject;
235-
236-
public class HelloWorld {
237-
238-
public static void main(String[] args) {
239-
240-
GraphQLObjectType queryType = newObject()
241-
.name("helloWorldQuery")
242-
.field(newFieldDefinition()
243-
.type(GraphQLString)
244-
.name("hello")
245-
.staticValue("world"))
246-
.build();
247-
248-
GraphQLSchema schema = GraphQLSchema.newSchema()
249-
.query(queryType)
250-
.build();
251-
Map<String, Object> result = new GraphQL(schema).execute("{hello}").getData();
252-
253-
System.out.println(result);
254-
// Prints: {hello=world}
255-
}
256-
}
257-
\`\`\`
258-
259-
See [the graphql-java docs](https://github.com/graphql-java/graphql-java) for more information on setup.
260-
261-
### Clojure
262-
263-
#### [alumbra](https://github.com/alumbra/alumbra)
264-
265-
A set of reusable GraphQL components for Clojure conforming to the data structures given in [alumbra.spec](https://github.com/alumbra/alumbra.spec).
266-
267-
\`\`\`clojure
268-
(require '[alumbra.core :as alumbra]
269-
'[claro.data :as data])
270-
271-
(def schema
272-
"type Person { name: String!, friends: [Person!]! }
273-
type QueryRoot { person(id: ID!): Person, me: Person! }
274-
schema { query: QueryRoot }")
275-
276-
(defrecord Person [id]
277-
data/Resolvable
278-
(resolve! [_ _]
279-
{:name (str "Person #" id)
280-
:friends (map ->Person (range (inc id) (+ id 3)))}))
281-
282-
(def QueryRoot
283-
{:person (map->Person {})
284-
:me (map->Person {:id 0})})
285-
286-
(def app
287-
(alumbra/handler
288-
{:schema schema
289-
:query QueryRoot}))
290-
291-
(defonce my-graphql-server
292-
(aleph.http/start-server #'app {:port 3000}))
293-
\`\`\`
294-
295-
\`\`\`bash
296-
$ curl -XPOST "http://0:3000" -H'Content-Type: application/json' -d'{
297-
"query": "{ me { name, friends { name } } }"
298-
}'
299-
{"data":{"me":{"name":"Person #0","friends":[{"name":"Person #1"},{"name":"Person #2"}]}}}
300-
\`\`\`
301-
302-
#### [graphql-clj](https://github.com/tendant/graphql-clj)
303-
304-
A Clojure library that provides a GraphQL implementation.
305-
306-
Code that executes a hello world GraphQL query with \`graphql-clj\`:
307-
308-
\`\`\`clojure
309-
310-
(def schema "type QueryRoot {
311-
hello: String
312-
}")
313-
314-
(defn resolver-fn [type-name field-name]
315-
(get-in {"QueryRoot" {"hello" (fn [context parent & rest]
316-
"Hello world!")}}
317-
[type-name field-name]))
318-
319-
(require '[graphql-clj.executor :as executor])
320-
321-
(executor/execute nil schema resolver-fn "{ hello }")
322-
\`\`\`
323-
324-
- [lacinia](https://github.com/walmartlabs/lacinia): A full implementation of the GraphQL specification that aims to maintain external compliance with the specification.
325-
326-
### Go
327-
328-
- [graphql-go](https://github.com/graphql-go/graphql): An implementation of GraphQL for Go / Golang.
329-
- [graphql-relay-go](https://github.com/graphql-go/relay): A Go/Golang library to help construct a graphql-go server supporting react-relay.
330-
- [neelance/graphql-go](https://github.com/neelance/graphql-go): An active implementation of GraphQL in Golang.
331-
332-
### PHP
365+
## GraphQL Clients
333366
334-
- [graphql-php](https://github.com/webonyx/graphql-php): A PHP port of GraphQL reference implementation
335-
- [graphql-relay-php](https://github.com/ivome/graphql-relay-php): A library to help construct a graphql-php server supporting react-relay.
367+
- [C# / .NET](#c-net-1)
368+
- [Java / Android](#java-android)
369+
- [JavaScript](#javascript-1)
370+
- [Swift / iOS](#swift-ios)
336371
337372
### C# / .NET
338373
339-
- [graphql-dotnet](https://github.com/graphql-dotnet/graphql-dotnet): GraphQL for .NET
340-
- [graphql-net](https://github.com/ckimes89/graphql-net): Convert GraphQL to IQueryable
341-
342-
### Elixir
343-
344-
- [absinthe](https://github.com/absinthe-graphql/absinthe): GraphQL implementation for Elixir.
345-
- [graphql-elixir](https://github.com/graphql-elixir/graphql): An Elixir implementation of Facebook's GraphQL.
346-
347-
### Erlang
374+
- [graphql-net-client](https://github.com/bkniffler/graphql-net-client): Basic example GraphQL client for .NET.
348375
349-
- [graphql-erlang](https://github.com/shopgun/graphql-erlang): GraphQL implementation in Erlang.
376+
### Java / Android
350377
351-
## GraphQL Clients
378+
- [Apollo Android](https://github.com/apollographql/apollo-android): A strongly-typed, caching GraphQL client for Android, written in Java.
352379
353380
### JavaScript
354381
@@ -360,21 +387,12 @@ Code that executes a hello world GraphQL query with \`graphql-clj\`:
360387
361388
- [Apollo iOS](http://dev.apollodata.com/ios/) ([github](https://github.com/apollostack/apollo-ios)): A GraphQL client for iOS that returns results as query-specific Swift types, and integrates with Xcode to show your Swift source and GraphQL side by side, with inline validation errors.
362389
363-
### Java / Android
364-
365-
- [Apollo Android](https://github.com/apollographql/apollo-android): A strongly-typed, caching GraphQL client for Android, written in Java.
366-
367-
### C# / .NET
368-
369-
- [graphql-net-client](https://github.com/bkniffler/graphql-net-client): Basic example GraphQL client for .NET.
370-
371390
## Tools
372391
373392
- [graphiql](https://github.com/graphql/graphiql) ([npm](https://www.npmjs.com/package/graphiql)): An interactive in-browser GraphQL IDE.
374393
- [libgraphqlparser](https://github.com/graphql/libgraphqlparser): A GraphQL query language parser in C++ with C and C++ APIs.
375394
- [Graphql Language Service](https://github.com/graphql/graphql-language-service): An interface for building GraphQL language services for IDEs (diagnostics, autocomplete etc).
376395
377-
378396
## More Stuff
379397
380398
- [awesome-graphql](https://github.com/chentsulin/awesome-graphql): A fantastic community maintained collection of libraries, resources, and more.

0 commit comments

Comments
 (0)