> For the complete documentation index, see [llms.txt](https://help.tacinsight.com/fast-weigh-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.tacinsight.com/fast-weigh-knowledge-base/references/api-documentation/graphql-v2-api/graphql-schema.md).

# GraphQL Schema

{% hint style="info" %}
The GraphQL API is an additional feature. If you would like to add the GraphQL Api to your Fast Weigh subscription, contact us at *865-219-2980* or <support@tacinsight.com>.
{% endhint %}

GraphQL provides a live schema via introspection of the API endpoint. That's a nerdy way of saying the available fields are always up to date and you don't have to worry about the documentation being stale!

## **How to View the Schema**

Head to the endpoint directly and hit "Browse Schema"

<figure><img src="https://490131596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0LJDMCSYOqplCEgCo73X%2Fuploads%2FEVKC8EnLHr1cWkVujJ8f%2Fimage.png?alt=media&amp;token=a1d4b8f1-283d-4fef-8296-67e7875a783a" alt=""><figcaption></figcaption></figure>

If you have already created a new "Document", you can also view the Schema by clicking the Schema button on the top-left of the screen (under the "Document" name)

## Making Sense of the Schema

GraphQL queries are based on "Types". These types are similar to a SQL Table. A "Customer" database table, for example, becomes a "Customer" type in GraphQL.

### **Root type**

First, you'll need to drill into a "root" type, two of which are available:

* `Query`
* `Mutation`

In the vast majority of cases, `Query` is what you're after. It's equivalent to a `SELECT` query in SQL.

The `mutation` is used to directly add/update/delete data via the API.

<figure><img src="https://490131596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0LJDMCSYOqplCEgCo73X%2Fuploads%2FOVYrLQKRt2JOOu3wqXZy%2Fimage.png?alt=media&amp;token=e1edd4ba-def2-47b2-9599-6a8ae2b007dd" alt=""><figcaption></figcaption></figure>

If you're following along, click into the `Query` to continue.

### **Exploring a GraphQL Type**

Inside the `Query` you'll see a list of available Types to explore.

<figure><img src="https://490131596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0LJDMCSYOqplCEgCo73X%2Fuploads%2Fw5ckmbnebDcQef9hKkWx%2Fimage.png?alt=media&amp;token=6b802aab-a42c-4a88-8d95-f7b7a518eea5" alt=""><figcaption></figcaption></figure>

Let's click into the Customer type `Customer` in purple.

<figure><img src="https://490131596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0LJDMCSYOqplCEgCo73X%2Fuploads%2FgCHUaPBWh2jT72BdLuBq%2Fimage.png?alt=media&amp;token=7921405d-3707-4249-875b-a63203f47601" alt=""><figcaption></figcaption></figure>

Here, you'll see a link to view the fields available on the Customer type.

<figure><img src="https://490131596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0LJDMCSYOqplCEgCo73X%2Fuploads%2FHZONPrbVyUpPtqr3Uahe%2Fimage.png?alt=media&amp;token=a8745948-bd0b-420f-8302-db993d3318de" alt=""><figcaption></figcaption></figure>

If you go back to the Query types and find Customer again, you'll also see a `where` and `order` section under the main type

<figure><img src="https://490131596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0LJDMCSYOqplCEgCo73X%2Fuploads%2FgCHUaPBWh2jT72BdLuBq%2Fimage.png?alt=media&amp;token=7921405d-3707-4249-875b-a63203f47601" alt=""><figcaption></figcaption></figure>

This time, click the `CustomerFilterInput` in green.

Here, you will see a list of fields that can be passed into the type to filter the results returned.

<figure><img src="https://490131596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0LJDMCSYOqplCEgCo73X%2Fuploads%2FZynwKwVUm2i68E69cdIs%2Fimage.png?alt=media&amp;token=f2248dd7-505b-49d0-9200-ef5a597c1e22" alt=""><figcaption></figcaption></figure>

If we select a filter input, we can see the exact filters that can be applied to that field. Let's select `address1`

Now, we can see every argument that can be used to filter the address 1 field

<figure><img src="https://490131596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0LJDMCSYOqplCEgCo73X%2Fuploads%2FZK1LnobraEda38sYmIzt%2Fimage.png?alt=media&amp;token=fe655a4c-cdf0-4460-a212-6e33fdfffd6f" alt=""><figcaption></figcaption></figure>

For example, the `endsWith: String` input tells you that you can filter this field by how the string ends

```graphql
query getCustomerIdByAddress {
  customers(where: { address1: { endsWith: "st" } }) {
    customerID
    customerName
    address1
  }
}

```

{% hint style="info" %}
**Note that different field types contain different filter arguments!**&#x20;

For example, "String" accepts arguments like "contains", but an "Int" type does not. Conversely, "Int" accepts arguments like "gt" (Greater Than), but a "String" type does not.

Explore all of the different OperationFilterInput types to see what they accept!
{% endhint %}

Wiring queries and arguments/filters are covered further in our [GraphQL Query Crash Course](/fast-weigh-knowledge-base/references/api-documentation/graphql-v2-api/graphql-query-crash-course.md)
