Files
apollo/docs/api/apollo-query.md
T
Guillaume Chau 56f317af07 docs: big update
2018-06-18 18:11:46 +02:00

1.5 KiB

ApolloQuery component

Props

  • query: GraphQL query (transformed by graphql-tag)
  • variables: Object of GraphQL variables
  • fetchPolicy: See apollo fetchPolicy
  • pollInterval: See apollo pollInterval
  • notifyOnNetworkStatusChange: See apollo notifyOnNetworkStatusChange
  • context: See apollo context
  • skip: Boolean disabling query fetching
  • clientId: Used to resolve the Apollo Client used (defined in ApolloProvider)
  • deep: Boolean to use deep Vue watchers
  • tag: String HTML tag name (default: div)

Scoped slot

  • result: Apollo Query result
    • result.data: Data returned by the query
    • result.loading: Boolean indicating that a request is in flight
    • result.error: Eventual error for the current result
    • result.networkStatus: See apollo networkStatus
  • query: Smart Query associated with the component
  • isLoading: Smart Query loading state
  • gqlError: first GraphQL error if any
  • times: number of times the result was updated

Events

  • result(resultObject)
  • error(errorObject)