cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

_Neo4jDateTimeInput has completely stopped working. I can't UPDATE DateTime objects AT ALL. WTF

jonathan
Node Clone

I don't get it. This was working... I am passing a DateTime object in grapqhl like this:

{ formatted: "the date string" } that worked i mean it literally worked like 2 days ago. i have ALWAYS passed DateTime like this... but now i am getting the error no such field formatted

so i tried adding the date object with constituent parts

{ day: 02, month: 10, year: 2020 } that also doesn't work... look at this error:

Error: GraphQL error: year must be an integer value, but was a DoubleValue

WHAT? i mean isn't DoubleValue a JAVA type? 2020 is an integer for crying out loud.

My entire project is blocked by this issue now. What changed? I don't understand???

3 REPLIES 3

MuddyBootsCode
Graph Steward

Have you tried passing it as string? Does seem very strange.

hi again @MuddyBootsCode, thanks for your help in the other thread about deleting nodes, i haven't tried that yet.

so I am curious about your response. _Neo4jDateTimeInput expects an object, why do you suggest i pass it as a string. I try that and it will fail.

const dateTime = incidentData.dateTime

[GraphQL error]: Message: Variable "$dateTime" got invalid value "2020-07-27T22:32:56Z"; Expected type "_Neo4jDateTimeInput" to be an object.

--
const dateTime = { formatted: incidentData.dateTime }

[GraphQL error]: Message: No such field: formatted,

This is the full request payload:

  "operationName": "UpdateIncident",
  "variables": {
    "id": "3094896f-b779-4148-b88e-95254b5b88d6",
    "assets": [
      {
        "id": "af3a3452-f8a6-4d53-a7bd-62c68a259815",
        "mimeType": "image/jpeg",
        "name": "dd0.jpg",
        "size": 36444,
        "url": "https://firebasestorage.googleapis.com/v0/b/safetymanaged-ef467.appspot.com/o/102a34bc-1bd8-44ad-957c-f39bac392e87%2Fincident%2F3094896f-b779-4148-b88e-95254b5b88d6%2Fdd0.jpg?alt=media&token=555ed514-fc0f-4a20-9461-523fed3caf61"
      },
      {
        "id": "bd5715f4-686f-40f1-9761-6492d5c74afa",
        "mimeType": "image/jpeg",
        "name": "85005326_2750774941637831_3321213414457475072_n.jpg",
        "size": 149978,
        "url": "https://firebasestorage.googleapis.com/v0/b/safetymanaged-ef467.appspot.com/o/102a34bc-1bd8-44ad-957c-f39bac392e87%2Fincident%2F3094896f-b779-4148-b88e-95254b5b88d6%2F85005326_2750774941637831_3321213414457475072_n.jpg?alt=media&token=e83e4137-cd50-40b5-a134-88e85a9812ec"
      }
    ],
    "consequences": [
      "Asset Loss"
    ],
    "description": "Shirley was placing panels that needs to be silkscreen on a rack with several shelfs. On the highest shelf she placed part improperly with part of the part hanging off the edge of the shelf. As she went to take part off lower shelf the part fell and struck her across her nose causing a minor bruise. ",
    "dateTime": {
      "formatted": "2020-07-27T22:32:56Z"
    },
    "location": "Laboratory 78",
    "status": "draft",
    "title": "IMPROPER PLACEMENT OF PARTS",
    "updatedAt": [
      {
        "formatted": "2020-09-22T11:01:40-05:00"
      },
      {
        "formatted": "2020-10-21T10:46:05-05:00"
      }
    ],
    "user": {
      "firstName": "Jonathan",
      "lastName": "Dryhurst Roberts"
    },
    "victims": [],
    "version": 1
  },
  "query": "mutation UpdateIncident($id: ID!, $consequences: [String], $dateTime: _Neo4jDateTimeInput, $description: String, $location: String, $status: String, $title: String, $updatedAt: [_Neo4jDateTimeInput], $version: Int) {\n  UpdateIncident(id: $id, consequences: $consequences, dateTime: $dateTime, description: $description, location: $location, status: $status, title: $title, updatedAt: $updatedAt, version: $version) {\n    id\n    dateTime {\n      formatted\n    }\n    description\n    title\n    updatedAt {\n      formatted\n    }\n  }\n}\n"```

MuddyBootsCode
Graph Steward

Hmm when I get a chance I'll make something with some date time fields and give it a shot.