spring-petclinic / spring-petclinic-graphql

PetClinic Example based on GraphQL
Other
212 stars 123 forks source link

Add new query API for ordering the retrieved owners. #7

Closed champagne closed 6 years ago

champagne commented 6 years ago

image

nilshartmann commented 6 years ago

Hi!

That's a good improvement for the API!

Just one idea, what do you think: should we maybe "merge" all three owner-Queries into one field?

Old

# Return all known Pet Owners
  owners: [Owner!]!
# Return the Owner with the specified field
  ownersByFilter(filter: OwnerFilter): [Owner!]!
# Return the Owner with the specified order
  ownersByOrder(orders: [OwnerOrder!]!): [Owner!]!

New:

# Return all known Pet Owners
owners(filter: OwnerFilter, orders: [OwnerOrder!]): [Owner!]!

Both filter and orders were optional, if not specified the current behaviour of owners would take effect (which is - I think - just return all Owners unordered as returned by the DB)

Again thank you veeery much for your effort and contributions!

champagne commented 6 years ago

Hi Nils,

Ah, yes, that's just what I'd thought to do it later. OK, let me have a look how we could align these three APIs together.

BR, Xiangbin

champagne commented 6 years ago

Hi Nils, It's ready, please have a look at my branch. 5 3_filter 5 3_order 5 3_ok

BR, Xiangbin

nilshartmann commented 6 years ago

thanks again for your contribution, @champagne !

champagne commented 6 years ago

My pleasure.

Any new idea that I could contribute, I'd like to do more.