Skip to content

Conversation

@huv1k
Copy link
Collaborator

@huv1k huv1k commented Feb 12, 2018

Fixes #322 #171.

Changes proposed in this pull request:

Added link to unions, renamed details for enums etc and added interfaces

const implementationsOffset =
obj.fields.length + obj.interfaces.length + obj.args.length

const typeInstance =
Copy link
Collaborator Author

@huv1k huv1k Feb 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not happy with this style of coding, but was trying to follow lint rules. I can change it to something like this:

if (type instanceof GraphQLInterfaceType) {
  typeInstance = 'interface'
} else if (type instanceof GraphQLUnionType) {
  typeInstance = 'union'
} else if (type instanceof GraphQLEnumType) {
  typeInstance = 'enum'
} else {
  typeInstance = 'type'
}

What looks better in my eyes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that look definitely better! You can also identify that linting rule and ignore it in the tslint config.
I already had a lot of cases where this rule forced you to do this ugly ternary stuff.

@timsuchanek timsuchanek merged commit 5b31743 into master Mar 27, 2018
@huv1k huv1k deleted the interface branch March 28, 2018 12:15
RenovZ pushed a commit to RenovZ/graphql-playground that referenced this pull request Mar 25, 2022
* Fixing interfaces and unions in docs

* Change linting and conditions

* Prettier not working correctly?
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

Successfully merging this pull request may close these issues.

3 participants