Giter VIP home page Giter VIP logo

perfect-graphql-starter's Introduction

Perfect GraphQL Starter

"Have no fear of perfection, you’ll never reach it." - Salvador Dali

Why

This project aims to be a place for the community to spread good practices and the use of related technologies.

It is inspired by the tutorial How to build a GraphQL server and its repository.

There will never be an agreement on a perfect boilerplate project for any technology we are aware of and it would not be different for a GraphQL-based project. But it doesn't mean we should not try to get as close as we can get from it. So please don't mind our pretentious project name, it's just a catchy one.

Install

As simple as that:

git clone https://github.com/Quadric/perfect-graphql-starter
cd perfect-graphql-starter
npm install
npm start

Getting started

(Run)

{
  getAuthor(_id: 2) {
    lastName
    posts {
      text
    }
  }
}
  • Hit the play button (cmd-return), then you should get this on the right side:
{
  "data": {
    "getAuthor": {
      "lastName": "Lombardi",
      "posts": [
        {
          "text": "Perfection is not attainable, but if we chase perfection we can catch excellence.",
        }
      ]
    }
  }
}

Examples

There is more you can try! Go back to the interactive tool and paste any of the following snippets there and check the result:

(Run)

{
  getAuthor(_id: 2) {  # Almost the same as
    firstName          # before, but with extra
    lastName           # fields.
    posts {
      title
      text
      views
    }
  }
}

(Run)

{
  getPostsByTitle(titleContains: "fear") {
    title               # Try adding the 'author'
    text                # field anywhere inside
    views               # this block ;)
  }
}

(Run)

{
  getPostsByAuthor(authorId:1) {  # This author has a private
    title                         # post. You should get an
    text                          # Authorization error.
    views
  }
}

perfect-graphql-starter's People

Contributors

zvictor avatar

Watchers

James Cloos avatar mumulife 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.