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

schema_printer._print_object should return interfaces joined with '&' instead of ',' #220

Open
msyfls123 opened this issue Nov 17, 2018 · 0 comments

Comments

@msyfls123
Copy link

https://github.com/graphql-python/graphql-core/blame/master/graphql/utils/schema_printer.py#L132

def _print_object(type):
    # type: (GraphQLObjectType) -> str
    interfaces = type.interfaces
    implemented_interfaces = (
        " implements {}".format(", ".join(i.name for i in interfaces))
        if interfaces
        else ""
    )

https://facebook.github.io/graphql/draft/#sec-Interfaces

type Business implements NamedEntity & ValuedEntity {
  name: String
  value: Int
  employeeCount: Int
}

I do think we can use & instead of , here, so we can simply print schema to a file rather than fetching it through graphql get-schema in JavaScript world.
I compare both of them which was generated in my project and find the only difference, even better with descriptions.
Thanks!

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

No branches or pull requests

1 participant