prisma / prisma-admin-feedback

Feedback for Prisma Admin (currently in invite-only preview)
6 stars 1 forks source link

Cannot read property 'getFields' of undefined #125

Open yoshiakis opened 5 years ago

yoshiakis commented 5 years ago

I created a sample service in Prisma Cloud and used Prisma Admin implemented in it to send the following query.

{
  post(where: {id: "cjukmf6fuass10b291xb4hs9q"}) {
    id
    title
  }
}

Then I've got an error Cannot read property 'getFields' of undefined. When I send the same query in GraphQL Playground, I can get a data as a response without error, so I think this is a bug in Prisma Admin.

The following is the detailed error message.

TypeError: Cannot read property 'getFields' of undefined
    at e.getFields (Engine.js:386)
    at e.getSelectionFields (Engine.js:171)
    at e.setQuery (Engine.js:191)
    at sagas.js:258
    at sagas.js:35
    at Object.next (sagas.js:16)
    at M (proc.js:311)
    at w (proc.js:388)
    at proc.js:699
    at N (proc.js:435)
    at M (proc.js:315)
    at e (proc.js:270)
    at L (proc.js:554)
    at N (proc.js:435)
    at M (proc.js:315)
    at w (proc.js:388)
    at proc.js:593
    at N (proc.js:435)
    at M (proc.js:315)
    at w (proc.js:388)
    at i (proc.js:466)
    at Object.put (channel.js:73)
    at channel.js:161
    at Array.<anonymous> (channel.js:182)
    at Object.emit (channel.js:26)
    at middleware.js:67
    at dispatch (applyMiddleware.js:35)
    at utils.js:250
    at proc.js:489
    at i (scheduler.js:19)
    at s (scheduler.js:60)
    at t.a (scheduler.js:33)
    at Array.<anonymous> (channel.js:185)
    at Object.emit (channel.js:26)
    at middleware.js:67
    at i.(anonymous function) (https://app.prisma.io/static/js/main.d6268a63.js:1:2587702)
    at onClick (Editor.js:95)
    at Object.<anonymous> (react-dom.production.min.js:14)
    at p (react-dom.production.min.js:15)
    at react-dom.production.min.js:15
    at O (react-dom.production.min.js:17)
    at j (react-dom.production.min.js:18)
    at k (react-dom.production.min.js:18)
    at D (react-dom.production.min.js:21)
    at _n (react-dom.production.min.js:84)
    at Du (react-dom.production.min.js:250)
    at Fe (react-dom.production.min.js:39)
    at jn (react-dom.production.min.js:86)
    at react-dom.production.min.js:251
    at Object.t.unstable_runWithPriority (scheduler.production.min.js:18)
sdnts commented 5 years ago

Hey @yoshiakis! That does look like a bug. We've just released a new version that changes some internals, and should hopefully fix this. Unfortunately, this is a breaking change, so you'd have to re-deploy your service using prisma deploy again. If you run into issues, you can read more about the release and the changes here

However, since you said this is a sample service, I'd just recommend deleting this one and creating a new one from scratch and running deploying it.

Let me know if you still see this!

yoshiakis commented 5 years ago

Thank you for dealing with this issue! Unfortunately though, I can't see if this issue is successfully resolved because of another issue.

sdnts commented 5 years ago

@yoshiakis Ah that's definitely an issue, I was able to see it as well. I'm just going to move it to the right repo, and someone should respond soon.

In the mean time, can you try using a Docker setup maybe? Steps here

kurt-o-sys commented 4 years ago

This still seems to be an issue, right? I'm on prisma cloud, and apparently, this issue isn't solved?