How to use the @vue/apollo-composable.useResult function in @vue/apollo-composable

To help you get started, we’ve selected a few @vue/apollo-composable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PECE-project / drupal-pece / src / front / graphql / composables / useEssays.js View on Github external
export default function useEssays ({ query, variables }) {
  const { result, loading, error } = useQuery(query, variables)

  const essays = useResult(result, null, (data) => {
    if (data.peceEssays && data.peceEssays.items.length) { return data.peceEssays.items }
    return null
  })

  return {
    essays,
    loading,
    error
  }
}
github PECE-project / drupal-pece / src / front / graphql / composables / useGqlRoute.js View on Github external
export default function useRoute ({ query, variables }) {
  const { result, loading, error } = useQuery(query, variables)

  const data = useResult(result, null, (data) => {
    if (data.route) { return data.route }
    return null
  })

  return {
    data,
    loading,
    error
  }
}

@vue/apollo-composable

Apollo GraphQL for Vue Composition API

MIT
Latest version published 1 month ago

Package Health Score

94 / 100
Full package analysis