Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Newbie questions #52

Closed
lfades opened this issue Dec 20, 2017 · 3 comments
Closed

Newbie questions #52

lfades opened this issue Dec 20, 2017 · 3 comments

Comments

@lfades
Copy link

lfades commented Dec 20, 2017

Hello guys, first of all I think I saw maybe a month ago a youtube video where this project was getting announced (and the IBM fancy stuff), I got very excited because Graphql microservices + schema stitching sounds very complicated to me but it's something that I really want to do, after that day I came here and realize that some parts of the docs were not yet done (Like the getting started) so before taking any early decision I waited to see the updates every 2 days, today I see that the page changed, some new commits were made, the getting started guide now works and it looks to me that this project is alive and cool, so aside from saying that I'm really excited for this I have the following questions before getting deep in the docs.

  • What happened to the old docs where the structure of the data source (model/connector/e.t.c) was explained ?
  • Can I consider this production ready ? or close enough ?
  • Will be possible to use something like micro-js (or one similar) instead of express ?

I haven't had the time to read the entire new docs but I will because I want to have something like this, thank you very much guys 💛

@ecwyne
Copy link
Collaborator

ecwyne commented Dec 20, 2017

Glad to hear GrAMPS is useful for you! (Me too!!)

  1. You can find the new "anatomy of a data source" here and a working example (with model/connector etc) here
  2. I would personally say that we're production ready but @jlengstorf may speak into that more because he's been using GrAMPS at IBM. The API is slightly different in 1.0 but the core concepts are pretty much the same.
  3. As far as I know, GrAMPS should work with all of the provided "Servers" from apollo

A simple micro server would look like this

import { microGraphiql, microGraphql } from 'apollo-server-micro';
import micro, { send } from 'micro';
import { get, post, router } from 'microrouter';
import gramps from '@gramps/gramps';
import XKCD from '@gramps/data-source-xkcd';
 
const graphqlHandler = microGraphql(gramps({dataSources: [XKCD]}));
const graphiqlHandler = microGraphiql({ endpointURL: '/graphql' });
 
const server = micro(
  router(
    get('/graphql', graphqlHandler),
    post('/graphql', graphqlHandler),
    get('/graphiql', graphiqlHandler),
    (req, res) => send(res, 404, 'not found')
  )
);
 
server.listen(3000);

@jlengstorf
Copy link
Member

Hey, @goluis — everything @ecwyne said is correct. We haven't put together all the examples yet, but GrAMPS returns a GraphQLOptions function that should be compatible with all flavors of Apollo server.

GrAMPS has been running in production at IBM Cloud, so it's definitely production-ready.

Please let us know if you have any additional questions! Also feel free to join the #gramps Slack channel for questions.

@ecwyne
Copy link
Collaborator

ecwyne commented Dec 20, 2017

You can sign up for the Graphcool slack channel here.

http://slack.graph.cool/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants