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

Attempting to implement multiple interfaces on a type causes an error #2727

Closed
arctop-sk opened this issue Aug 11, 2021 · 3 comments
Closed
Assignees

Comments

@arctop-sk
Copy link
Contributor

arctop-sk commented Aug 11, 2021

Describe the bug
A clear and concise description of what the bug is.
Implementing multiple interfaces on a type in a collection is broken, due to wrong delimiter between interfaces.

To Reproduce
Steps to reproduce the behavior:
add 2 interfaces to a collection, build fails

Expected behavior
type is built correctly

Source of the issue is likely here:

export const mainTypeTemplate = ({ typeName, description, interfaces, fields }) =>
${description ? # ${description}: ''} type ${typeName} ${interfaces.length ?implements ${interfaces.join(', ')} : ''}{ ${convertToGraphQL(fields, ' ')} };

${interfaces.join(', ')} should be ${interfaces.join(' & ')}

As multiple interfaces are defined as such:
type Business implements NamedEntity & ValuedEntity {
name: String
value: Int
employeeCount: Int
}

@eric-burel eric-burel self-assigned this Aug 12, 2021
@eric-burel
Copy link
Contributor

eric-burel commented Aug 12, 2021

Yes you're right, could you please try to open a PR so that I can fix this as soon as possible? It may also happen in Vulcan NPM

@eric-burel
Copy link
Contributor

Note that it seems that comma used to work in earlier version of graphql, but the & is the official syntax now

@arctop-sk
Copy link
Contributor Author

#2728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants