Coder Social home page Coder Social logo

Comments (8)

hekike avatar hekike commented on July 19, 2024

Hi! Do you have running MongoDB on your machine? It's needed for E2E tests.

from graffiti-mongoose.

hardchor avatar hardchor commented on July 19, 2024

I'm experiencing the same. I can see it creating the test entities in mongo, but it throws this error:

  e2e
    get schema
      singular query
--> this is where it goes wrong { message: 'Cast to ObjectId failed for value "undefined" at path "_id"',
  locations: [ { line: 2, column: 11 } ] }
query is correct, i.e. _id is not undefined:  {
          user(_id: "55daca1ed5f6e76f45f37b52") {
            _id
            name
            age
            mother {
              _id
              name
            }
            friends {
              _id
              name
            }
            objectIds
          }
        }

For reference, the error occurs here: https://github.com/RisingStack/graffiti-mongoose/blob/master/src/e2e.spec.js#L85

P.S.: This might not be the same issue. Some tests are passing for me.

from graffiti-mongoose.

hardchor avatar hardchor commented on July 19, 2024

Just tested a singular endpoint in my app and I'm getting the same.

{
    "@risingstack/graffiti": "^1.0.2",
    "@risingstack/graffiti-mongoose": "^1.6.1",
    "mongoose": "^4.1.3",
}

from graffiti-mongoose.

hardchor avatar hardchor commented on July 19, 2024

Sorry for the spam.

This could be down to this issue: Automattic/mongoose#2646

from graffiti-mongoose.

hekike avatar hekike commented on July 19, 2024

@hardchor @fcmatteo do you still think this is an issue with graffiti-mongoose? I'm quiet surprised, we are also running the e2e tests on TravisCI. I don't see any issue with them: https://travis-ci.org/RisingStack/graffiti-mongoose/builds

from graffiti-mongoose.

fcmatteo avatar fcmatteo commented on July 19, 2024

I'm sorry, I have been busy with other stuff, but yes, I have MongoDB running. In fact, the db 'graffiti-test' was created with the 'users' collection, which is empty.

from graffiti-mongoose.

hardchor avatar hardchor commented on July 19, 2024

Had mongoose 4.1.3.
Force-installed 4.0.6 - still broken.
Reset, reinstalled - works.

What on earth?

from graffiti-mongoose.

fcmatteo avatar fcmatteo commented on July 19, 2024

I force-installed [email protected] and it worked.

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.