Skip to content

Allow nodes to skip the registry #104

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

Merged
merged 1 commit into from
Feb 18, 2017

Conversation

Tritlo
Copy link
Contributor

@Tritlo Tritlo commented Feb 2, 2017

I've added an option to nodes to skip the registry. This allows the user to control whether the node implementation of a model gets used. My use case is that I want to enable:

class PrivateProfileNode(DjangoObjectType):
  email = graphene.Field(graphene.String)
  username = graphene.Field(graphene.String)

  class Meta:
    model = Profile
    interfaces = (graphene.relay.Node,)
    skip_registry = True


class ProfileNode(DjangoObjectType):
  username = graphene.Field(graphene.String)

  class Meta:
    model = Profile
    interfaces = (graphene.relay.Node,)

without having to worry about the email leaking out via some other nodes.

@coveralls
Copy link

coveralls commented Feb 2, 2017

Coverage Status

Coverage increased (+0.009%) to 92.497% when pulling fbeea2c on Tritlo:skip-registry into 5d6c7f2 on graphql-python:master.

5 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 92.497% when pulling fbeea2c on Tritlo:skip-registry into 5d6c7f2 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 92.497% when pulling fbeea2c on Tritlo:skip-registry into 5d6c7f2 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 92.497% when pulling fbeea2c on Tritlo:skip-registry into 5d6c7f2 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 92.497% when pulling fbeea2c on Tritlo:skip-registry into 5d6c7f2 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 92.497% when pulling fbeea2c on Tritlo:skip-registry into 5d6c7f2 on graphql-python:master.

@coveralls
Copy link

coveralls commented Feb 2, 2017

Coverage Status

Coverage increased (+0.009%) to 92.497% when pulling aed7229 on Tritlo:skip-registry into 5d6c7f2 on graphql-python:master.

@coveralls
Copy link

coveralls commented Feb 2, 2017

Coverage Status

Coverage increased (+0.009%) to 92.497% when pulling aed7229 on Tritlo:skip-registry into 5d6c7f2 on graphql-python:master.

@syrusakbary
Copy link
Member

Interesting approach! Will think a little bit more about it, but I think is a good idea :)

@syrusakbary
Copy link
Member

With the PR #115, this will be done but using skip_global_registry instead :)

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