menu

Prisma

🔴 The Prisma Spectrum community is not officially managed by Prisma's support team any more. Please seek help on GitHub or on Slack instead. Learn more: https://spectrum.chat/prisma/general/where-and-how-to-best-seek-help-with-questions-problems~687a1b8f-8658-4df3-8849-ea5ab3503f28

Channels
Chat
view-forward
# All channels
view-forward
# General
view-forward
# Beta
view-forward
# Community
view-forward
# GraphQL
view-forward
# OSS
view-forward
# Random
view-forward
Team

create mutation with other type in the argument

January 24, 2020 at 11:30am

create mutation with other type in the argument

January 24, 2020 at 11:30am
hi everyone i have some problem with my mutation 'createStudentBadge' , i wanna know how can i add another type in field with the argument . For example i have that mutation in my file TypeDef :
createStudentBadge( badge: badge! optainedAt: String! isActive: Boolean! ): Badge
type Badge { id: ID! requirement: String! title: String! image: String! rarity: Rarity }
i know it's wrong because the argument Badge it's not a string , it's a type with many argument so how can i add exactly this argument in the mutation ? thanks

January 24, 2020 at 4:00pm
You can pass badge’s id
  • reply
  • like
Or you can do the following:
  • reply
  • like
createStudentBadge( badge: Badgeinput! optainedAt: String! isActive: Boolean! ): Badge
type Badge { id: ID! requirement: String! title: String! image: String! rarity: Rarity }
type Badgeinput { requirement: String! title: String! image: String! rarityID: ID }
  • reply
  • like
Create new input type
  • reply
  • like
and look at the rarityID where we could pass ID
  • reply
  • like
thanks a lot ! 🙏
like-fill
1
  • reply
  • like