VulcanJS / vulcan-docs

📖 Docs for React/Apollo/Meteor version of Vulcan
http://docs.vulcanjs.org
42 stars 86 forks source link

tutorial-framework.md#fragments problem #20

Closed HaveF closed 7 years ago

HaveF commented 7 years ago

Hi, Before fragments part, the console throw error Error: Fragment "MoviesItemFragment" not registered., it is exactly like the doc said:

At this stage, we’ll probably get an error message saying the fragment we’re using is not yet defined. To remedy this, create a new fragments.js file inside modules:

After I done the fragments part, I can not get the doc result, but instead a error.

2017-04-24 9 07 48

It seems the fragments not works, the graphql query string is not properly constructed.

2017-04-24 9 13 02

So, what can I do next?

HaveF commented 7 years ago

terminal information:

I20170424-09:07:38.947(8)? { [Error: GraphQL error: Cannot query field "undefined" on type "Query".]
I20170424-09:07:38.948(8)?   graphQLErrors:
I20170424-09:07:38.948(8)?    [ { message: 'Cannot query field "undefined" on type "Query".',
I20170424-09:07:38.949(8)?        locations: [Object] } ],
I20170424-09:07:38.949(8)?   networkError: null,
I20170424-09:07:38.949(8)?   message: 'GraphQL error: Cannot query field "undefined" on type "Query".',
I20170424-09:07:38.949(8)?   extraInfo: undefined,
I20170424-09:07:38.950(8)?   queryErrors: [ [Circular] ] }
W20170424-09:07:38.955(8)? (STDERR) Mon Apr 24 2017 09:07:38 GMT+0800 (CST) 'error while server-rendering' 'Error: GraphQL error: Cannot query field "undefined" on type "Query".\n    at ApolloError.Error (native)\n    at new ApolloError (/Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/apollo-client/apollo.umd.js:1845:28)\n    at /Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/apollo-client/apollo.umd.js:2691:41\n    at /Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/apollo-client/apollo.umd.js:3115:25\n    at Array.forEach (native)\n    at /Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/apollo-client/apollo.umd.js:3112:27\n    at Array.forEach (native)\n    at QueryManager.broadcastQueries (/Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/apollo-client/apollo.umd.js:3109:42)\n    at QueryManager.broadcastNewStore (/Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/apollo-client/apollo.umd.js:2499:14)\n    at /Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/apollo-client/apollo.umd.js:3167:44\n => awaited here:\n    at Function.Promise.await (/Users/HaveF/.meteor/packages/promise/.0.8.8.1ba92yi++os+web.browser+web.cordova/npm/node_modules/meteor-promise/promise_server.js:35:12)\n    at Object.options.preRender (packages/vulcan:routing/lib/server/routing.jsx:52:22)\n    at generateSSRData (packages/vulcan:routing/lib/server/router.jsx:51:15)\n    at sendSSRHtml (packages/vulcan:routing/lib/server/router.jsx:79:25)\n    at packages/vulcan:routing/lib/server/router.jsx:136:11\n    at /Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/react-router/lib/match.js:67:5\n    at /Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/react-router/lib/createTransitionManager.js:99:11\n    at done (/Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/react-router/lib/AsyncUtils.js:79:19)\n    at /Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/react-router/lib/AsyncUtils.js:85:7\n    at getComponentsForRoute (/Users/HaveF/Desktop/newTech/vulcan_tutorial/node_modules/react-router/lib/getComponents.js:11:5)'
HaveF commented 7 years ago

After recheck the doc, copy/paste code, still get error, but different one. 2017-04-25 9 46 46

2017-04-25 9 47 08

graphiql is fine: 2017-04-25 9 48 36

make a new branch for reproduce this issue:

https://github.com/HaveF/Vulcan/tree/tutorial-framework

SachaG commented 7 years ago

Fixed here: https://github.com/VulcanJS/Vulcan/commit/6693768e6e4d568551304e51f8610943209c4b53