Skip to content

Allow ConnectionFields to have ObjectTypes as per relay spec - #237

Merged
syrusakbary merged 9 commits into
graphql-python:masterfrom
Globegitter:connection-fields-object-types
Jul 30, 2016
Merged

syrusakbary merged 9 commits into
graphql-python:masterfrom
Globegitter:connection-fields-object-types

Conversation

@Globegitter

Copy link
Copy Markdown

In the Relay spec it says that the node of a ConnectionField does not actually have to be a node but can also be an objectType: https://facebook.github.io/relay/graphql/connections.htm#sec-Node

@coveralls

coveralls commented Jul 26, 2016 •

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 603d477 on Globegitter:connection-fields-object-types into * on graphql-python:master*.

@coveralls

coveralls commented Jul 26, 2016 •

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 603d477 on Globegitter:connection-fields-object-types into * on graphql-python:master*.

@Globegitter

Copy link
Copy Markdown
Author

Also as a note, we are using this patch already locally in our graphene. So really hope this functionality makes it in. Even if it is in a different way with 1.0.

I am also happy btw to make these last PRs agains the 1.0 branch if you want @syrusakbary

`relay.Connection.for_node(NodeType)(edges=edges, page_info=relay.PageInfo(has_next_page=has_next_page))` in a resolver
@coveralls

coveralls commented Jul 28, 2016 •

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 2a288ea on Globegitter:connection-fields-object-types into * on graphql-python:master*.

@Globegitter

Copy link
Copy Markdown
Author

I know my last commit is not directly related but since I am already touching the code I thought I'd fix that here as well. This is something we notice when trying to return a Connection directly instead of a list, that it actually does not work with the given isinstance check.

@coveralls

coveralls commented Jul 28, 2016 •

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 0d9e645 on Globegitter:connection-fields-object-types into * on graphql-python:master*.

@coveralls

coveralls commented Jul 28, 2016 •

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 0d9e645 on Globegitter:connection-fields-object-types into * on graphql-python:master*.

@coveralls

coveralls commented Jul 28, 2016 •

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 0d9e645 on Globegitter:connection-fields-object-types into * on graphql-python:master*.

@syrusakbary

Copy link
Copy Markdown
Member

Good catch! I would like to merge.

I'm refactoring the base code of graphene, so would be great if we have tests covering the use case so we assure support for this in the future (the tests will remain very similar even in the refactor).

@Globegitter

Copy link
Copy Markdown
Author

@syrusakbary Added tests for both fixes in here :)

@coveralls

coveralls commented Jul 29, 2016 •

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 878391b on Globegitter:connection-fields-object-types into * on graphql-python:master*.

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.

4 participants