Skip to content

Commit fd9ca77

Browse files
authored
Merge pull request graphql#1152 from mmiller-max/mm/-docs-add-graphqlclient
docs: Add GraphQLClient.jl
2 parents daf3396 + 3d6696f commit fd9ca77

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: GraphQLClient.jl
3+
description: A Julia GraphQL client for seamless integration with a GraphQL server
4+
url: https://github.com/DeloitteDigitalAPAC/GraphQLClient.jl
5+
github: DeloitteDigitalAPAC/GraphQLClient.jl
6+
---
7+
8+
- **Querying**, **mutating** and **subscribing** without manual writing of query strings (unless you want to!)
9+
- Deserializing responses directly into Julia types
10+
- **Construction of Julia types** from GraphQL objects
11+
- Using **introspection** to help with querying
12+
13+
### Quickstart
14+
15+
Install with Julia's package manager
16+
17+
```
18+
using Pkg; Pkg.add("GraphQLClient")
19+
using GraphQLClient
20+
```
21+
22+
Connect to a server
23+
24+
```julia
25+
client = Client("https://countries.trevorblades.com")
26+
```
27+
28+
Build a Julia type from a GraphQL object
29+
30+
```julia
31+
Country = GraphQLClient.introspect_object(client, "Country")
32+
```
33+
34+
And query the server, deserializing the response into this new type
35+
36+
```julia
37+
response = query(client, "countries", Vector{Country}, output_fields="name")
38+
```
39+
40+
Alternatively write the query string manually
41+
42+
```julia
43+
query_string = """
44+
{
45+
countries{
46+
name
47+
}
48+
}"""
49+
50+
response = GraphQLClient.execute(client, query_string)
51+
```

0 commit comments

Comments
 (0)