question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Relay filtering single object

See original GitHub issue

For example I have this type, the model is AbstractUser

class UserType(DjangoObjectType):
    class Meta:
        model = UserModel
        interfaces = (graphene.relay.Node, )
        filter_fields = ['username']

class Query(graphene.ObjectType):
    user = graphene.relay.Node.Field(UserType)
    all_users = DjangoFilterConnectionField(UserType)

I want to be able to do this:

query {
    user(username: "Bob") {
        first_name
        last_name
    }
}

How I could implement this type of behaviour without using get() method?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
impowskicommented, Jun 4, 2018

Ok, I guess I figured it finally, will post my update shortly.

0reactions
jkimbocommented, Dec 16, 2018

@impowski I’m going to close this issue now. Please do post any updates you have here for posterity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django graphene relay restricting queries to objects owned ...
I am using graphene 2, django 2, and django-filter 1.11. class AnimalFilter(django_filters.FilterSet): # Do case-insensitive lookups on 'name' ...
Read more >
GraphQL Directives | Relay
The @refetchable directive can only be added to fragments that are "refetchable", that is, on fragments that are declared on Viewer or Query...
Read more >
A deep dive into the Relay store - Yash Mahalwal - Medium
We know that getValue works only when the field to be fetched is a primitive or an array of primitive types. But what...
Read more >
Getting Started with Lightspeed Filter
Let's get you up and filtering with Lightspeed Filter! First thing is first, let's get your devices setup to be filtered and then...
Read more >
Multi-camera Relay Tracker Utilizing Color-Based Particle ...
Multi-camera Relay Tracker Utilizing Color-Based Particle Filtering ... If an object is detected in one camera, the other camera can then be controlled...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found