GraphQXL is a new language built on top of the GraphQL syntax that extends the original language with some additional features useful for creating scalable and big server side schemas.
There is a WIP version of the GraphQXL book with some useful docs, you can check it here
Use the spread operator to inherit fields from other types or inputs. Descriptions will also be inherited.
| Source GraphQXL | Compiled GraphQL |
|---|---|
type _OtherType {
"Descriptions are also inherited"
bar: Int!
}
type MyType {
foo: String!
..._OtherType
}
#GraphQXL |
type MyType {
foo: String!
"Descriptions are also inherited"
bar: Int!
}
#GraphQL |
Declare generic types and inputs in order to reuse common structures across your schema.
| Source GraphQXL | Compiled GraphQL |
|---|---|
type Generic<T> {
foo: T
}
type MyStringType = Generic<String!>
type MyIntType = Generic<Int!>
#GraphQXL |
type MyStringType {
foo: String!
}
type MyIntType {
foo: Int!
}
#GraphQL |
Modify types and inputs with built-in modifiers.
| Source GraphQXL | Compiled GraphQL |
|---|---|
type _MyType {
foo: String
bar: String!
}
type MyTypeRequired = Required<_MyType>
type MyTypeOptional = Optional<_MyType>
#GraphQXL |
type MyTypeRequired {
foo: String!
bar: String!
}
type MyTypeOptional {
foo: String
bar: String
}
#GraphQL |
Import other .graphqxl files and use their definitions in the current file.
| Source GraphQXL | Compiled GraphQL |
|---|---|
# my_file.graphqxl
import "other_file"
type MyType {
foo: OtherType!
}
#GraphQXL# other_file.graphqxl
type OtherType {
bar: Int!
}
#GraphQXL |
# my_file.graphql
type OtherType {
bar: Int!
}
type MyType {
foo: OtherType!
}
#GraphQL |
For brew users:
brew install graphqxlThere is built-in support for the following programming languages:
There are also precompiled binaries for each architecture that you can download directly from GitHub releases:
Mac M1
wget https://github.com/gabotechs/graphqxl/releases/latest/download/graphqxl-aarch64-apple-darwin.tar.gz
tar -xvf graphqxl-aarch64-apple-darwin.tar.gzMac Intel
wget https://github.com/gabotechs/graphqxl/releases/latest/download/graphqxl-x86_64-apple-darwin.tar.gz
tar -xvf graphqxl-x86_64-apple-darwin.tar.gzLinux x86_64
wget https://github.com/gabotechs/graphqxl/releases/latest/download/graphqxl-x86_64-unknown-linux-gnu.tar.gz
tar -xvf graphqxl-x86_64-unknown-linux-gnu.tar.gzLinux aarch64
wget https://github.com/gabotechs/graphqxl/releases/latest/download/graphqxl-aarch64-unknown-linux-gnu.tar.gz
tar -xvf graphqxl-aarch64-unknown-linux-gnu.tar.gz./graphqxl foo.graphqxlthis will output foo.graphql as a result