graphql-editor / graphql-zeus

GraphQL client and GraphQL code generator with GraphQL autocomplete library generation ⚡⚡⚡ for browser,nodejs and react native ( apollo compatible )
https://graphqleditor.com/docs/zeus
MIT License
1.95k stars 106 forks source link

Is it possible to combine selectors? #369

Closed rjmackay closed 1 year ago

rjmackay commented 1 year ago

If I have an existing selector i.e.

const orderSelection = Selector('Order')({
  orderId: true
})

Is it possible to merge this with another selection? Like:

    const result = await this.client('query')({
      getOrder: [
        { orderId },
        {
          ...orderSelection,
          phone: true,
        },
      ],
    })

Basically I'd like some way to combine selections similar to graphql Fragments.

aexol commented 1 year ago

yes