Skip to main content
Weaviate Docs (migrated from docs.weaviate.io) Docs

Search documentation

Type to search this documentation.

On this pageOverview

Search (GraphQL | gRPC)

Weaviate offers GraphQL and gRPC APIs for queries.

We recommend using a Weaviate client library, which abstracts away the underlying API calls and makes it easier to integrate Weaviate into your application.

However, you can query Weaviate directly using GraphQL with a POST request to the /graphql endpoint, or write your own gRPC calls based on the gRPC protobuf specification.

All references have their individual subpages. Click on one of the references below for more information.

GraphQL is a query language built on using graph data structures. It is an efficient method of data retrieval and mutation, since it mitigates the common over-fetching and under-fetching problems of other query languages.

You can POST a GraphQL query to Weaviate as follows:

Bash
curl http://localhost/v1/graphql -X POST -H 'Content-type: application/json' -d '{GraphQL query}'

A GraphQL JSON object is defined as:

JSON
{
    "query": "{ # GRAPHQL QUERY }"
}

GraphQL queries follow a defined structure. Queries are structured as follows:

GraphQL
{
  <Function> {
      <Collection> {
        <property>
        _<underscore-property>
      }
  }
}

GraphQL integer data currently only supports int32, and does not support int64. This means that currently integer data fields in Weaviate with integer values larger than int32, will not be returned using GraphQL queries. We are working on solving this issue. As current workaround is to use a string instead.

GraphQL (Get) queries are run with a tunable consistency level.

Starting with Weaviate v1.19.0, a gRPC interface is being progressively added to Weaviate.

gRPC is a high-performance, open-source universal RPC framework that is contract-based and can be used in any environment. It is based on HTTP/2 and Protocol Buffers, and is therefore very fast and efficient.

Read more about the gRPC API here.

Have a question or feedback? Here's how to reach us.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu