New version questions & thoughts (v4)

I hope I’m not missing anything, but one thing I’d love to see if the ability with GraphQL find() to query not only based on ID, but also on any other field, especially relation.

For example, instead of doing something like:

const STRAPI_SHIP_Q = gql`
  query StrapiShip($shipId: ID!) {
    ship(id: $shipId) {
      id
      galaxyOfOrigin
    }
  }
`;

I would love to be able to do:

const STRAPI_SHIP_Q = gql`
  query StrapiShip($pilotId: ID!) {
    ship(pilot: $pilotId) {
      id
      galaxyOfOrigin
    }
  }
`;

Currently I would have to handle this with where on multiple-entry query, which is not ideal (notice the ships (plural) instead of ship (singular):

const STRAPI_SHIP_Q = gql`
  query StrapiShip($pilotId: ID!) {
    ships(where: { pilot: $pilotId }) {
      id
      galaxyOfOrigin
    }
  }
`;

and then handle the array of results to return a single entry.

Hope I’m making sense here.

Cheers to all for the awesome questions and awesome work, v4!!! :fire:

3 Likes