Stupid GraphQL Questions with Hez™: Let's say I ...
# orm-help
h
Stupid GraphQL Questions with Hez™: Let's say I have the following schema:
Copy code
type Thing {
  thingID: String!
  createdAt: DateTime!
  updatedAt: DateTime!
  thingProfile: ThingProfile
}

type ThingProfile {
  thingID: String
  thingPropertyA: String
  thingPropertyB: String
}

type Mutation {
  createThingProfile(
    thingID: String
    thingProfile: ThingProfile
    ): Thing
}
And I want to add a
profile
to a
thing
that was not initialized with a
profile
...using a mutation on the
thing
.... how would I do this? This feels like it should be possible...but I'm stumbling on the config
n
you would run a nested mutation
updateThing(where: { thingID: "mything id" }, data: { thingProfile: { connect: { ... }} }) { ... }
not that you need to mark
thingID
as
@unique
in both
Thing
and
ThingProfile
this is in the datamodel which you refer to in
prisma.yml