Skip to content

Aliases #2

@thomassuckow

Description

@thomassuckow

When there is a conflict between fields this library resolves the arguments differently. The tree will claim the argument is one thing (2) but the resolve method for foo will claim another (1).

query {
  a {
    foo(arg: 1) {
      id
    }
    foo(arg: 2) {
      id
    }
  }
}

This is a bad case and I would argue you're in trouble anyway, but this leads us to another thing: aliases

This library has no handling for:

query {
  a {
    foo(arg: 1) {
      id
    }
    bar: foo(arg: 2) {
      id
    }
  }
}

I would argue for aliases resulting in an array in the tree with a $alias field.

Now, I think for what I am working on I will ignore using aliases and conflicts so this is a low priority to me. But I wanted to post this as a shortcoming because I think an alternate implementation of graphql-server centered around a tree like this has a lot of potential.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions