GithubHelp home page GithubHelp logo

zebapy / graphcool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prisma/prisma1

0.0 2.0 0.0 6.67 MB

⚡️ GraphQL development framework to build production-ready GraphQL backends

Home Page: https://docs-next.graph.cool

Shell 0.34% JavaScript 3.95% TypeScript 95.71%

graphcool's Introduction

CircleCI Slack Status npm version

WebsiteDocsForumChatTwitter

Graphcool is a GraphQL backend development framework. Think about it like Rails or Meteor but based on GraphQL and designed for today's (serverless) infrastructure.

  • GraphQL abstraction over your database
  • Enables scalable, event-driven architectures
  • Compatible with existing tools (GraphQL.js, Apollo, Serverless)

Contents

Note: This is a preview version of the Graphcool Framework. More information in the forum.
This readme is currently WIP and there are still some bugs & missing features in the framework.

Quickstart

Watch this 2 min tutorial or follow the steps below to get started with the Graphcool framework:

  1. Install the CLI via NPM:
npm install -g graphcool@next
  1. Create a new service:

The following command creates all files you need for a new service.

graphcool init
  1. Define your data model:

Next edit types.graphql to define your data model using the GraphQL SDL notation.

type User @model {
  id: ID! @isUnique
  name: String!
  dateOfBirth: DateTime

  # You can declare relations between models like this
  posts: [Post!]! @relation(name: "UserPosts")
}


type Post @model {
  id: ID! @isUnique
  title: String!

  # Every relation also required a back-relation (to determine 1:1, 1:n or n:m)
  author: User! @relation(name: "UserPosts")
}
  1. Implement permissions & business logic:

The graphcool.yml file is the core of the framework and can be used to implement any kind of authorization and business logic.

# Define your data model here
types: types.graphql

# Configure the permissions for your data model
permissions:
- operation: "*"

# tokens granting root level access to your API
rootTokens: []

# You can implement your business logic using functions
functions:
  hello:
    handler:
      code: src/hello.js
    type: resolver
    schema: src/hello.graphql
  1. Deploy your service:

To deploy your service simply run the following command and select either a hosted BaaS cluster or automatically setup a local Docker-based development environment:

graphcool deploy
  1. Connect to your GraphQL endpoint:

Use the endpoint from the previous step in your frontend (or backend) applications to connect to your GraphQL API.

Features

Examples

  • crud-api: Simple CRUD-style GraphQL API
  • auth: Email/password-based authentication & user permissions
  • send-email: Send email via Mailgun via GraphQL mutation
  • push-notifications: Send push notification when new Post is created
  • env-variables: Function accessing environment variables
  • rest-wrapper: Extend GraphQL API by wrapping existing REST endpoint
  • full-example: Full example (webshop) demoing most available features

Architecture

Graphcool is a new kind of framework. We are in the process of writing technical articles explaining the architecture. Meanwhile you can check out this article detailing how we use the Graphcool Framework to operate a global GraphQL Backend as a Service:

Graphcool Infrastructure Deep Dive

Deployment

Philosophy

FAQ

Wait a minute – isn't Graphcool a Backend-as-a-Service?

While Graphcool started out as a Backend-as-a-Service (like Firebase or Parse), we're currently in the process of turning Graphcool into a backend development framework. No worries, you can still deploy your Graphcool services to the BaaS platform as before but additionally you can now also run Graphcool on your own machine.

Roadmap

Help us shape the future of the Graphcool Framework by 👍 existing Feature Requests or creating new ones

We are in the process of setting up a formal road map. Check back here in the coming weeks to see the new features we are planning!

Note: functions are currently not working for local cluster setups (use the BaaS deployment for now).

Community

Graphcool has a community of thousands of amazing developers and contributors. Welcome, please join us! 👋

Contributing

Your feedback is very helpful, please share your opinion and thoughts!

+1 an issue

If an existing feature request or bug report is very important for you, please go ahead and 👍 it or leave a comment. We're always open to reprioritize our roadmap to make sure you're having the best possible DX.

Requesting a new feature

We love your ideas for new features. If you're missing a certain feature, please feel free to request a new feature here. (Please make sure to check first if somebody else already requested it.)

graphcool's People

Contributors

apoeco avatar cjoudrey avatar julianbauer avatar kbrandwijk avatar ludovicgueth avatar marktani avatar merott avatar nikolasburk avatar schickling avatar sorenbs avatar timsuchanek avatar

Watchers

 avatar  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.