Skip to content

docs: Add GraphQLClient.jl #1152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions src/content/code/language-support/julia/client/graphqlclient-jl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: GraphQLClient.jl
description: A Julia GraphQL client for seamless integration with a GraphQL server
url: https://github.com/DeloitteDigitalAPAC/GraphQLClient.jl
github: DeloitteDigitalAPAC/GraphQLClient.jl
---

- **Querying**, **mutating** and **subscribing** without manual writing of query strings (unless you want to!)
- Deserializing responses directly into Julia types
- **Construction of Julia types** from GraphQL objects
- Using **introspection** to help with querying

### Quickstart

Install with Julia's package manager

```
using Pkg; Pkg.add("GraphQLClient")
using GraphQLClient
```

Connect to a server

```julia
client = Client("https://countries.trevorblades.com")
```

Build a Julia type from a GraphQL object

```julia
Country = GraphQLClient.introspect_object(client, "Country")
```

And query the server, deserializing the response into this new type

```julia
response = query(client, "countries", Vector{Country}, output_fields="name")
```

Alternatively write the query string manually

```julia
query_string = """
{
countries{
name
}
}"""

response = GraphQLClient.execute(client, query_string)
```