Crate vector_api_client

Source
Expand description

Vector GraphQL client library, for the Vector GraphQL API server.

Contains:

  1. A GraphQL query client, for queries/mutations over HTTP(s)
  2. A GraphQL subscription client, for long-lived, multiplexed subscriptions over WebSockets
  3. GraphQL queries/mutations/subscriptions, defined in graphql/**/*.graphql files
  4. Extension methods for each client, for executing queries/subscriptions, and returning deserialized JSON responses

Modules§

gql
GraphQL queries Queries, subscriptions, and extension methods for executing them
test

Structs§

Client
GraphQL query client over HTTP.
Payload
Payload contains the raw data received back from a GraphQL subscription. At the point of receiving data, the only known fields are { id, type }; what’s contained inside the payload field is unknown until we attempt to deserialize it against a generated GraphQLQuery::ResponseData later.
SubscriptionClient
A single SubscriptionClient enables subscription multiplexing.

Functions§

connect_subscription_client
Connect to a new WebSocket GraphQL server endpoint, and return a SubscriptionClient. This method will a) connect to a ws(s):// endpoint, and perform the initial handshake, and b) set up channel forwarding to expose just the returned Payloads to the client.

Type Aliases§

BoxedSubscription
Subscription GraphQL response, returned from an active stream.
QueryResult
Wrapped Result type, that returns deserialized GraphQL response data.