GithubHelp home page GithubHelp logo

sergiodxa / grial Goto Github PK

View Code? Open in Web Editor NEW
189.0 9.0 10.0 137 KB

A Node.js framework for creating GraphQL API servers easily and without a lot of boilerplate.

Home Page: https://github.com/sergiodxa/grial/wiki

License: MIT License

JavaScript 100.00%
nodejs grial graphql graphql-server graphql-js graphql-api graphql-subscriptions api-server framework connector

grial's Introduction

Grial

A Node.js framework for creating GraphQL API servers easily and without a lot of boilerplate.

No Maintenance Intended styled with prettier standard license

Why?

There's a lot of boilerplate code required to run a GraphQL API with Node.js, the server code it's almost always the same, create a server, load the resolvers and the schema and set the /graphql endpoint along with GraphiQL.

Grial allow you to only think about your business logic and API and is responsible for implementing the boilerplate code for you.

Grial also provide you with connectors you can use to consume many data sources easily.

Documentation

You can check the Grial docs in the repository wiki

grial's People

Contributors

antoniopresto avatar joernroeder avatar sergiodxa avatar xrevo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grial's Issues

Allow @grial/server context customization

Right now it's impossible to customize the context of each request in @grial/server, I want it to be customizable somehow. Also allow the customization of the WS server context.

Test Grial

Right now the code is not tested, we need at least the @grial/server and @grial/utils packages tested.

Cache DB connection

Thanks for the awesome framework!
Could we save the connection to databases to reuse in other parts of the application?
Something like:

const MongoClient = require("mongodb");

const connectionCache = {};

async function mongodb(URL) {
  if (connectionCache[URL]) return connectionCache[URL];

  const connectionPromise = new Promise((resolve, reject) => {
    MongoClient.connect(URL, (error, connection) => {
      if (error) return reject(error);
      resolve(connection);
    });
  });

  connectionCache[URL] = connectionPromise;
  return connectionPromise;
}

exports.mongodb = mongodb;

remove file extension from required files

By removing the file extension from the import of e.g.resolvers.js we'd be able to import resolvers.js or resolvers/index.js which acts as an entry point and reexports all resolvers.
I've seen that you have basically implemented the same concept for schema.ggl|grapgl and files within the schemas/*.ggl|graphql folder and it's a common concept to structure your application.

I'll help with a implementation in the future, just let me know what do you think…

Lodash dependency

Just a quick heads up:
followed all steps in the tutorial on Medium but kept getting error even after removing /node_modules and reinstalling dependencies:

> grial start
module.js:487
    throw err;
    ^
Error: Cannot find module 'lodash'
    at Function.Module._resolveFilename (module.js:485:15)

Only yarn add lodash resolved this issue and everything worked according to the tutorial.
Is this a correct behavior or should the Grial server work without loading the whole Lodash lib?

404 Not Found: @grial/cli@latest

Hi, i'm very interested in your project, but unfortunately can't try it out due to the error i'm getting from npm install (other packages are installed fine on the same machine).
Any idea how to fix the problem?

create-grial-api

Create a CLI tool that follow the create-* name convention to start new projects with Grial and have the default files and some test files.

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.