aerogear / offix-android

Apollo GraphQL offline extensions for Android Platform
https://android.offix.dev
Apache License 2.0
37 stars 16 forks source link

Error while fetching data on playground. #113

Closed Lavanyagaur22 closed 5 years ago

Lavanyagaur22 commented 5 years ago

Description

While creating a task using mutation:

mutation {
    createTask(input: {
    version: 1,
    title: "Task 1",
    description: "Hello 1",
    status: "Open"   
  }){
 version
  id
  } 
}  

I got the following error:

{
  "errors": [
    {
      "message": "Cannot return null for non-nullable field Task.id.",
 ...

Why is it returning this instead of returning the id?

Lavanyagaur22 commented 5 years ago

Also, what's the command to empty the database?

Lavanyagaur22 commented 5 years ago

Also, upon running queries and mutations on the playground, we are getting this:

Screenshot 2019-08-12 at 12 25 58 PM

If we don't get any data back, we would be having problems with inflating data in the app.

wtrocki commented 5 years ago

@Lavanyagaur22 This is graphback issue. Do you mind dropping this issue text into graphback. I will fix that in our server manually.

harshithdwivedi commented 5 years ago

Same here,

{
  "errors": [
    {
      "message": "Cannot return null for non-nullable field Task.id.",
      "locations": [
        {
          "line": 3,
          "column": 5
        }
      ],
      "path": [
        "createTask",
        "id"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "Error: Cannot return null for non-nullable field Task.id.",
            "    at completeValue (C:\\Users\\harsh\\Desktop\\graphql\\offix-android\\sample\\server\\node_modules\\graphql\\execution\\execute.js:596:13)",
            "    at completeValueCatchingError (C:\\Users\\harsh\\Desktop\\graphql\\offix-android\\sample\\server\\node_modules\\graphql\\execution\\execute.js:531:19)",
            "    at resolveField (C:\\Users\\harsh\\Desktop\\graphql\\offix-android\\sample\\server\\node_modules\\graphql\\execution\\execute.js:471:10)",
            "    at executeFields (C:\\Users\\harsh\\Desktop\\graphql\\offix-android\\sample\\server\\node_modules\\graphql\\execution\\execute.js:311:18)",
            "    at collectAndExecuteSubfields (C:\\Users\\harsh\\Desktop\\graphql\\offix-android\\sample\\server\\node_modules\\graphql\\execution\\execute.js:747:10)",
            "    at completeObjectValue (C:\\Users\\harsh\\Desktop\\graphql\\offix-android\\sample\\server\\node_modules\\graphql\\execution\\execute.js:737:10)",
            "    at completeValue (C:\\Users\\harsh\\Desktop\\graphql\\offix-android\\sample\\server\\node_modules\\graphql\\execution\\execute.js:626:12)",
            "    at completeValue (C:\\Users\\harsh\\Desktop\\graphql\\offix-android\\sample\\server\\node_modules\\graphql\\execution\\execute.js:593:21)",
            "    at C:\\Users\\harsh\\Desktop\\graphql\\offix-android\\sample\\server\\node_modules\\graphql\\execution\\execute.js:528:16"
          ]
        }
      }
    }
  ],
  "data": null
}
Lavanyagaur22 commented 5 years ago

Also, upon running queries and mutations on the playground, we are getting this:

Screenshot 2019-08-12 at 12 25 58 PM

If we don't get any data back, we would be having problems with inflating data in the app.

@wtrocki @harshithdwivedi If we don't get data back, how we are going to inflate it in app?

wtrocki commented 5 years ago

@Lavanyagaur22 This is because you have made some changes that broke it? I get data back for all queries/mutations.

Feel free to improve server as you wish.

Lavanyagaur22 commented 5 years ago

Yeah, was about to close the issue. Getting it now.