Closed jordanh closed 8 years ago
Call me crazy, but i think we should word it so the webpack method is the default & the CLI is the back-up, almost footnote-ish ("opinionated software" and whatnot :wink:). I don't really see them as equals, since if you take the webpack route you'll never have to worry about a stale schema. That alone would be enough to make me use webpack in my project.
i'll merge for now & we can wordsmith later.
I'm getting Module build failed: ReferenceError: regeneratorRuntime is not defined
when implementing the loader from the docs, and as far as I can see regeneratorRuntime
isn't actually included anywhere in lib
. This might be because you're both running node v6
hmmm, must be missing a babel-polyfill
somewhere
@jordanh I can't get the loader working after adding babel-polyfill
to cashay/src/index.js
import { transformSchema } from 'cashay'
import schema from './index'
// Side-step 'Error: Schema must be an instance of GraphQLSchema.'
const graphql = require('graphql').graphql
export default async () => await transformSchema(schema, graphql)
It just keeps complaining Module build failed: TypeError: doc.then is not a function
. I'm a bit confused since the async/await
should return a promise no matter what. Could it be something related to the babel-polyfill
?
My ./index
contains the following:
import mocks from './mocks'
import resolvers from './resolvers'
import createSchema from './createSchema'
export default createSchema({ resolvers, mocks })
can confirm, var doc = this.exec(content, this.resource);
is returned an object, not a promise, which isn't supposed to happen...
This is my getCashaySchema.babel.js
:
require('babel-register');
require('babel-polyfill');
module.exports = require('./getCashaySchema')();
@simenbrekken: @mattkrick and I talk about this this morning, I clarified the docs and example for this.
See #58 !
Now it's official! 💯