“Kueri Sequnce Graphql” Kode Jawaban

Kueri Sequnce Graphql

export default compose(
  graphql(firstQuery, {
    name: 'firstQuery'
  }),
  graphql(secondQuery, { 
    name: 'secondQuery',
    skip: ({ firstQuery }) => !firstQuery.data,
    options: ({firstQuery}) => ({
      variables: {
          var1: firstQuery.data.someQuery.someValue
      }
    })
  })
)(withRouter(TestPage))
Embarrassed Echidna

Kueri Sequnce Graphql

<Query query={firstQuery}>
  {({ data: { someQuery: { someValue } = {} } = {} }) => (
    <Query
      query={secondQuery}
      variables={{var1: someValue}}
      skip={someValue === undefined}
    >
      {({ data: secondQueryData }) => (
        // your component here
      )}
</Query>
Embarrassed Echidna

Jawaban yang mirip dengan “Kueri Sequnce Graphql”

Pertanyaan yang mirip dengan “Kueri Sequnce Graphql”

Lebih banyak jawaban terkait untuk “Kueri Sequnce Graphql” di JavaScript

Jelajahi jawaban kode populer menurut bahasa