Graphcool / graphcool-framework

Apache License 2.0
1.77k stars 131 forks source link

Importing data.zip requires a reset of data before working #527

Open mhinc14 opened 6 years ago

mhinc14 commented 6 years ago

Current behavior

importing a data.zip (NDF) into an existing project causes missing data in fields with an '@relation'.

eg for the type below everything will import correctly apart from 'surveys' and 'labels' because they have an @relation

type Variable @model {
  id: ID! @isUnique
  name: String
  displayName: String
  orderID: Int
  surveys: [Survey!]! @relation(name: "SurveyVariables")
  labels: [Label!]! @relation(name: "VariableLabels")
}

However if i delete / reset all nodes (ie. delete all the data) and then do an import it seems to work fine and import everything as expected.

Reproduction

1) clone an existing project 2) add a node that contains an @relation field 3) export via the cli 4) import data into the unchanged project via the cli 5) you should see the added node but with null wherever there is an @relation field but all other data eg name should be there.

If your problem can be reproduced with a certain service definition, please create a new GitHub repository with the reproduction instructions.

Expected behavior?

importing data into a project with the same schema should import all data including fields with an @relation