Crate vector_api_client
source ·Expand description
Vector GraphQL client library, for the Vector GraphQL API server.
Contains:
- A GraphQL query client, for queries/mutations over HTTP(s)
- A GraphQL subscription client, for long-lived, multiplexed subscriptions over WebSockets
- GraphQL queries/mutations/subscriptions, defined in
graphql/**/*.graphql
files - Extension methods for each client, for executing queries/subscriptions, and returning deserialized JSON responses
Modules§
- GraphQL queries Queries, subscriptions, and extension methods for executing them
Structs§
- GraphQL query client over HTTP.
- 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. - A single
SubscriptionClient
enables subscription multiplexing.
Functions§
- 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 returnedPayload
s to the client.
Type Aliases§
- Subscription GraphQL response, returned from an active stream.
- Wrapped
Result
type, that returns deserialized GraphQL response data.