Coder Social home page Coder Social logo

iq-scm / graphqxl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gabotechs/graphqxl

0.0 0.0 0.0 1.45 MB

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. This repository contains the source code for the GraphQXL compiler.

Home Page: https://gabotechs.github.io/graphqxl

License: MIT License

Rust 100.00%

graphqxl's Introduction

Coverage Status Book

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.

Documentation

There is a WIP version of the GraphQXL book with some useful docs, you can check it here

Features

Object inheritance

Use the spread operator to inherit fields from other types or inputs. Descriptions will also be inherited.

Try it yourself!

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

Generics

Declare generic types and inputs in order to reuse common structures across your schema.

Try it yourself!

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

Modifiers

Modify types and inputs with built-in modifiers.

Try it yourself!

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 statements

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

Install

For brew users:

brew install graphqxl

There 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.gz

Mac 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.gz

Linux 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.gz

Linux 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

Usage

./graphqxl foo.graphqxl

this will output foo.graphql as a result

graphqxl's People

Contributors

gabotechs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.