Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grooviter/gql
Groovy GraphQL library
https://github.com/grooviter/gql
graphql groovy-language
Last synced: 4 days ago
JSON representation
Groovy GraphQL library
- Host: GitHub
- URL: https://github.com/grooviter/gql
- Owner: grooviter
- License: apache-2.0
- Created: 2017-04-01T16:16:04.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-10-27T00:57:03.000Z (13 days ago)
- Last Synced: 2024-10-27T01:32:17.202Z (13 days ago)
- Topics: graphql, groovy-language
- Language: Groovy
- Homepage: http://grooviter.github.io/gql/
- Size: 2.78 MB
- Stars: 49
- Watchers: 7
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - grooviter/gql - Groovy GraphQL library (Groovy)
README
[![license](https://img.shields.io/github/license/grooviter/gql.svg)]() [![main](https://github.com/grooviter/gql/actions/workflows/gql-release.yml/badge.svg)](https://github.com/grooviter/gql/actions/workflows/gql-release.yml) ![Maven Central](https://img.shields.io/maven-central/v/com.github.grooviter/gql-core) ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/com.github.grooviter/gql-core?server=https%3A%2F%2Fs01.oss.sonatype.org)
## Description
**GQL** is a set of [Groovy](http://www.groovy-lang.org) DSLs and AST
transformations built on top
of [GraphQL-java](https://github.com/graphql-java/graphql-java) that
make it easier to build GraphQL schemas and execute **GraphQL**
queries without losing type safety.## Gradle
In order to use `GQL` releases in your Groovy code add the maven central repository and if you'd like to evaluate some
snapshots add the sonatype snapshots repository as well:```groovy
repositories {
mavenCentral()
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' } // FOR SNAPSHOTS
}
```Once you've declared the maven repositories then add the dependencies to your project:
```groovy
dependencies {
implementation 'com.github.grooviter:gql-core:VERSION'
implementation 'com.github.grooviter:gql-ratpack:VERSION'
}
```## Getting Started
You can directly execute the following example in your Groovy console:
```groovy
@Grab('com.github.grooviter:gql-core:0.5.0')
import gql.DSLdef GraphQLFilm = DSL.type('Film') {
field 'title', GraphQLString
field 'year', GraphQLInt
}def schema = DSL.schema {
queries {
field('lastFilm') {
type GraphQLFilm
staticValue(title: 'SPECTRE', year: 2015)
}
}
}def query = """
{
lastFilm {
year
title
}
}
"""def result = DSL.newExecutor(schema).execute(query)
assert result.data.lastFilm.year == 2015
assert result.data.lastFilm.title == 'SPECTRE'
```## Documentation
Current documentation is available at: http://grooviter.github.io/gql/