ramsaylanier / wordexpress-starter-vue

WordPress with Vue, GraphQL, and Node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL error

michellekondou opened this issue · comments

Hi, I'm also excited to try this out; I'm getting an error though after running npm run dev, the following, does it ring a bell?

error during render : /
{ Error: GraphQL error: Variable "$post_type" of type "[String]" used in position expecting type "String".
at ApolloError.Error (native)
at new ApolloError (C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-client\bundle.umd.js:76:28)
at C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-client\bundle.umd.js:952:41
at C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-client\bundle.umd.js:1333:17
at Array.forEach (native)
at C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-client\bundle.umd.js:1332:18
at Map.forEach (native)
at QueryManager.broadcastQueries (C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-client\bundle.umd.js:1327:22)
at Object.next (C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-client\bundle.umd.js:1361:31)
at notifySubscription (C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-link\node_modules\zen-observable\lib\Observable.js:123:18)
at onNotify (C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-link\node_modules\zen-observable\lib\Observable.js:158:3)
at SubscriptionObserver.next (C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-link\node_modules\zen-observable\lib\Observable.js:212:7)
at C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-link-dedup\lib\bundle.umd.js:54:76
at Array.forEach (native)
at Object.next (C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-link-dedup\lib\bundle.umd.js:54:43)
at notifySubscription (C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-link\node_modules\zen-observable\lib\Observable.js:123:18)
at onNotify (C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-link\node_modules\zen-observable\lib\Observable.js:158:3)
at SubscriptionObserver.next (C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-link\node_modules\zen-observable\lib\Observable.js:212:7)
at C:\sites\ncwr\wordexpress-starter-vue\node_modules\apollo-link-http\lib\bundle.umd.js:117:30
at process._tickCallback (internal/process/next_tick.js:109:7)
graphQLErrors:
[ { message: 'Variable "$post_type" of type "[String]" used in position expecting type "String".',
locations: [Object] } ],
networkError: null,
message: 'GraphQL error: Variable "$post_type" of type "[String]" used in position expecting type "String".',
extraInfo: undefined }
whole request: 157ms

I'm on windows 10, any help appreciated, thanks!

@michellekondou Hey, sorry! This is because I changed the Posts query to be able to accept an array of post types, but I didnt update the wordexpress-schema package in the wordexpress-server repo. WHOOPS!

In order to fix this, update the schema dependency in wordexpress-server (or, if you cloned the wordexpress-server repo you can pull upstream changes and run npm install again).

So, wherever you are running the server, update wordexpress-schema to the latest package which should be version 4.2.0.

Let me know if that works!

Also, for reference here is the history file for wordexpress-schema.