Git Product home page Git Product logo

Comments (24)

dsifford avatar dsifford commented on June 2, 2024

@neverfox Can you provide an example of some of the queries you are trying?

from graffiti-mongoose.

neverfox avatar neverfox commented on June 2, 2024

Well, I'm a total newbie when it comes to graphQL, but I was trying things from the examples like:

query UsersQuery {
  users {
    name
  }
}

I assume that if was just badly formed, I'd get an error inside of graphiql, but it's just failing at the source code level somehow. Do you know of a query that you know should work that I could try?

from graffiti-mongoose.

dsifford avatar dsifford commented on June 2, 2024

Hm.. I see what you mean..

The GraphiQL instance is not getting access to the database on my end. Tried to spin up the example on my end and no dice either.

@neverfox are you able to open up the "Doc" sidebar and see the schema? If not, you probably have the same issue.

I'd usually troubleshoot, but I'm strapped for time and I'm not familiar with koa.

from graffiti-mongoose.

neverfox avatar neverfox commented on June 2, 2024

Nope, no schema.

from graffiti-mongoose.

tothandras avatar tothandras commented on June 2, 2024

Make sure that MongoDB is running.

from graffiti-mongoose.

dsifford avatar dsifford commented on June 2, 2024

@tothandras Not sure that's the issue. MongoDB runs as a service on my machine (Ubuntu Wily) and I have no issues using graffiti in my own workflow.

from graffiti-mongoose.

jbach avatar jbach commented on June 2, 2024

I’m having the same issue, the first POST to /graphql is pending for quite some time, then fails. If I run the same query (query IntrospectionQuery…) via Postman, I get a proper response.

from graffiti-mongoose.

neverfox avatar neverfox commented on June 2, 2024

I'd love to get this sorted since this is my first experience with considering graphQL for my next project (tired of REST endpoints proliferating like bunnies).

Make sure that MongoDB is running.

Not only is it running, but I'm looking at the pre-populated data in MongoHub, so I know that was successful.

from graffiti-mongoose.

jbach avatar jbach commented on June 2, 2024

I have tracked down the problem: It works if I don’t use bodyParser.json() in my express app. Seems to be a problem with graffiti / co-body / raw-body. Can anyone confirm?

from graffiti-mongoose.

neverfox avatar neverfox commented on June 2, 2024

Since the example uses Koa, that might be the implicit default body parser there.

from graffiti-mongoose.

tothandras avatar tothandras commented on June 2, 2024

Can you try the examples in the graffiti project? I can't introduce the errors you are facing with. 😕

from graffiti-mongoose.

jbach avatar jbach commented on June 2, 2024

@tothandras Regarding express, the problem arises if you add JSON body parsing as often suggested/needed by third party plugins. The workaround is to not use body-parser at root level or to exclude the /graphql endpoint via something like express-unless. Would it be viable to check if the body still needs to be parsed here?

from graffiti-mongoose.

tothandras avatar tothandras commented on June 2, 2024

@jbach Would it be also viable to require body parsing by the plugin as other plugins do? :) Just drop it altogether and make it a requirement.

from graffiti-mongoose.

jbach avatar jbach commented on June 2, 2024

Probably. I checked up on co-body, it doesn’t seem to prevent double parsing like expressjs/body-parser does. I guess shifting that responsibility to the middleware would be my personal favorite.

from graffiti-mongoose.

kaminskypavel avatar kaminskypavel commented on June 2, 2024

+1 still having the same issue. any suggested work around?

graphql

from graffiti-mongoose.

KATT avatar KATT commented on June 2, 2024

+1

from graffiti-mongoose.

tothandras avatar tothandras commented on June 2, 2024

Thanks for the report! I will fix this tomorrow.

from graffiti-mongoose.

tothandras avatar tothandras commented on June 2, 2024

@KATT @jbach @kaminskypavel @neverfox @dsifford
Can you try version 3.0.1 of graffiti? I've removed the body parsing from the middleware. The examples have also been updated in both repositories.

from graffiti-mongoose.

kaminskypavel avatar kaminskypavel commented on June 2, 2024

@tothandras , nope, unfortunately still getting Uncaught TypeError: Cannot read property 'getQueryType' of undefined .

also please update the readme to port 8081.

from graffiti-mongoose.

jbach avatar jbach commented on June 2, 2024

@tothandras, it does work for me. 👍
@kaminskypavel, are you sure you updated both graffiti and graffiti-mongoose?

from graffiti-mongoose.

kaminskypavel avatar kaminskypavel commented on June 2, 2024

I did a clean checkout and install, am I missing something?

from graffiti-mongoose.

KATT avatar KATT commented on June 2, 2024

Eureka! I was struggling as well and noticed I was using npm 2.14.7 and node 4.2.1.

Once I did a simple nvm use 5 it all kicked off for me. 🎉

from graffiti-mongoose.

kaminskypavel avatar kaminskypavel commented on June 2, 2024

what version of node was it?

from graffiti-mongoose.

KATT avatar KATT commented on June 2, 2024
$ node --version
v5.2.0
$ npm --version
3.3.12

from graffiti-mongoose.

Related Issues (20)

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.