umbraco-community / umbraco-graphql

An implementation of GraphQL for Umbraco 8 using GraphQL for .NET.
MIT License
64 stars 32 forks source link

Need a way to get multiple objects by id (basically we need a byIds method) #40

Closed PeteDuncanson closed 3 years ago

PeteDuncanson commented 6 years ago

Trying to get multiple Hotels in my example. I can't seem to do it without having to use an alias for each on. Ideally I just want to pass in an array of ids and have an array of Hotels returned:

// With alias' but this returns an object with named fields 
// (hotel1 etc.) which you can't iterate over easily
{
  content {
    byType {
      hotel1: HotelPage(id: 2092) {
        pageTitle
      }
      hotel2: HotelPage(id: 2091) {
        pageTitle
      }
      hotel3: HotelPage(id: 2087) {
        pageTitle
      }
    }    
  }
}
// This is more what I want it to do
{
  content {
    byIds (ids: [123,234,355]) {
      ... on HotelPage {
        pageTitle
      }
    }    
  }
}
rasmusjp commented 3 years ago

Hi

Just wanted to let you know that the project is moving to the Umbraco Community GitHub organisation, so we are closing all existing issues.

If you think your issue is still relevant, please feel free to reopen it.

/Rasmus