Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input types to create objects #5

Closed
1 of 3 tasks
keski opened this issue May 15, 2019 · 4 comments
Closed
1 of 3 tasks

input types to create objects #5

keski opened this issue May 15, 2019 · 4 comments

Comments

@keski
Copy link
Collaborator

keski commented May 15, 2019

This issue covers parts of Section 5 of issue #1.

Add input types to create objects.

  • Implementation added
  • Tests created
  • All tests passed
@keski
Copy link
Collaborator Author

keski commented May 20, 2019

I went with naming the types according to the spec (i.e. DataToCreateX), for the naming of the generated input types.

@rcapshaw

@keski
Copy link
Collaborator Author

keski commented May 27, 2019

The code should now cover cases involving wrapped fields and cases where loops may occur. For now, test cases should cover:

type A {
   b1: B
   b2: B!
   b3: [B]
   b4: [B!]
   b5: [B]!
   b6: [B!]!
}

type B {
   a: A
}

@rcapshaw

@keski
Copy link
Collaborator Author

keski commented May 28, 2019

Now covers DataToCreateYOfX as stated in 5.1 Creating an Object of the spec. Example:

type Person {
  id: ID!
  name: String
  age: Int
  pet: [Dog]
}

type Dog {
  id: ID!
  name: String
}

input DataToConnectPetOfPerson {
  connect: ID
  create: DataToCreateDog
}

input DataToCreateDog {
  id: ID!
  name: String
}

input DataToCreatePerson {
  id: ID!
  name: String
  age: Int
  pet: [DataToConnectPetOfPerson]
}

type Mutation {
  createPerson(data: DataToCreatePerson): Person
  createDog(data: DataToCreateDog): Dog
}

@keski
Copy link
Collaborator Author

keski commented Jul 30, 2019

Moving the tasks related to tests to a separate issue (#23)

@keski keski closed this as completed Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant