This repository was archived by the owner on Dec 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 150
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
[BUG] Schema must contain unique named types but contains multiple types named "Recipient" #260
Copy link
Copy link
Closed
Labels
Milestone
Description
After merging #226 we have got an error message for loading documentation
"errors": [
{
"debugMessage": "Schema must contain unique named types but contains multiple types named \"Recipient\" (see http://webonyx.github.io/graphql-php/type-system/#type-registry).",
"message": "Internal server error",
"category": "internal",
"locations": [
{
"line": 6,
"column": 7
}
],
Proposed scheme
# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.
type Mutation {
sendEmailToFriend (input: SendEmailToFriendInput): SendEmailToFriendOutput @resolver(class: "\\Magento\\SendFriendGraphQl\\Model\\Resolver\\SendEmailToFriend") @doc(description:"Recommends Product by Sending Single/Multiple Email")
}
input SendEmailToFriendInput {
product_id: Int!
sender: SendEmailToFriendSender!
recipients: [SendEmailToFriendRecipient!]!
}
type SendEmailToFriendOutput {
sender: SendEmailToFriendSender
recipients: [SendEmailToFriendRecipient]
}
type SendEmailToFriendSender {
name: String!
email: String!
message: String!
}
type SendEmailToFriendRecipient {
name: String!
email: String!
}
Steps to reproduce:
- Performe quey
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
types {
...FullType
}
directives {
name
description
locations
args {
...InputValue
}
}
}
}
fragment FullType on __Type {
kind
name
description
fields(includeDeprecated: true) {
name
description
args {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields {
...InputValue
}
interfaces {
...TypeRef
}
enumValues(includeDeprecated: true) {
name
description
isDeprecated
deprecationReason
}
possibleTypes {
...TypeRef
}
}
fragment InputValue on __InputValue {
name
description
type { ...TypeRef }
defaultValue
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
}
Fix is replacing type on input
sender: SendEmailToFriendSender!
recipients: [SendEmailToFriendRecipient!]!
=>
sender: SendEmailToFriendSenderInput!
recipients: [SendEmailToFriendRecipientInput!]!
AGPDev