crystal-gql
Version, currently master branch1 version
- master branchlatestMay 6, 2021
github.com/itsezc/crystal-gql
A complete GraphQL client shard for the Crystal language inspired by Apollo client including error handling and planned support for caching, authentication and subscriptions.
6 stars
4 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
crystal-gql:
github: itsezc/crystal-gql
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.35.1- License
- MIT
- Author
- Chiru B
Dependencies
This version declares no dependencies.
README
GraphQL Client for Crystal
A GraphQL client shard for the Crystal language.
- Version: 0.1.3
- Crystal Version: 0.35.1
Usage
Installing
Just add this to your shards.yml file:
dependencies:
crystal-gql:
github: itsezc/crystal-gql
Then run:
shards install
Initializing
require "crystal-gql"
# Define the client
api = GraphQLClient.new "https://countries.trevorblades.com"
Querying
# useQuery
data, error, loading = api.useQuery(GQL {
"continents" => [
"code",
"name",
{
"countries" => [
"name",
"capital",
{
"languages" => [
"name"
]
}
]
}
]
})
# or traditional queries
data, error, loading = api.query("{
continents {
code
name
countries {
name
capital
languages {
name
}
}
}
}")
# Print data
print data
Querying
With authentication:
api.add_header("Authorization", "Bearer: TOKEN")
# useQuery
data, error, loading = api.useQuery(GQL {
"continents" => [
"code",
"name",
{
"countries" => [
"name",
"capital",
{
"languages" => [
"name"
]
}
]
}
]
})
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- May 6, 2021
- Crystal
0.35.1- Indexed
- yes
Dependents
Repository
github.com/itsezc/crystal-gql
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 1