Skip to content

Inline optional with where is not optional #233

Closed
@molexx

Description

@molexx

I want to get all Humans, and include their favoriteDroid if their favoriteDroid's name begins with 'R'. I want Humans who don't have a favoriteDroid or who's favoriteDroid is C3PO to still be listed but have favoriteDroid: null.

But for this:

query {
  Humans {
    select {
      id
      name
      favoriteDroid(optional:true, where:{name:{LIKE:"R%"}}) {
        name
      }
    }
  }
}

the 'optional' appears to have no effect - most Humans are excluded.

If there is no where clause then it works as expected - Humans with no favoriteDroid are returned with a null favoriteDroid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions