andreas / ocaml-graphql-server

GraphQL servers in OCaml
MIT License
624 stars 60 forks source link

Fields with differing arguments shouldn't be allowed #169

Open dwwoelfel opened 5 years ago

dwwoelfel commented 5 years ago

Queries with differing arguments for the same field should not be allowed.

An example of a query that should fail (see swapi example)

query AllFilms {
  allFilms(first: 1) {
    totalCount
  }
  allFilms(first: 2) {
    pageInfo {
      hasNextPage
    }
  }
}

An example of a query that should succeed (see swapi example)

query AllFilms {
  allFilms(first: 1) {
    totalCount
  }
  allFilms(first: 1) {
    pageInfo {
      hasNextPage
    }
  }
}

If #168 gets merged, merge_selections would be a good place to do the check for conflicting arguments.