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

fix: Support making Relay edges node NonNull (#968) #1493

Closed

Conversation

gurobokum
Copy link

@gurobokum gurobokum commented Feb 12, 2023

Support pointing edge and edge node as NonNull when using Relay Connections

class UserPhotosConnection(Connection):
    class Meta:
        node = UserPhoto

    class Edge:
        class Meta:
            required = True   # marks edge as NonNull
            node_required = True  # marks node as NonNull

Main issue: #968
Related issues: mcabrams/doppelganger#64, graphql-python/graphene-sqlalchemy#310

@gurobokum gurobokum force-pushed the issue-968/relay-edge-nonull branch from 7588fe7 to c8c7b68 Compare February 12, 2023 21:46
@codecov
Copy link

codecov bot commented Feb 15, 2023

Codecov Report

Base: 95.98% // Head: 95.99% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (c8c7b68) compared to base (340d5ed).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1493      +/-   ##
==========================================
+ Coverage   95.98%   95.99%   +0.01%     
==========================================
  Files          51       51              
  Lines        1742     1747       +5     
==========================================
+ Hits         1672     1677       +5     
  Misses         70       70              
Impacted Files Coverage Δ
graphene/relay/connection.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@erikwrede erikwrede left a comment

Choose a reason for hiding this comment

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

Thank your for taking the time to put this together! This will be useful for everyone using codegen until graphql/graphql-spec#867 is merged into the GQL-Spec. ☺️

Can you please merge the new tests into the existing connection tests? It will be easier to find that way, as issue tests usually refer to specific bugs, but this is a feature that belongs to the core implementation.

@erikwrede
Copy link
Member

This was superseded by #1504 and is released in 3.3.0 😊

@erikwrede erikwrede closed this Jul 27, 2023
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.

2 participants