# GraphQL API Platform

Our API platform is basically a richer GraphiQL. The concept is the same, but it displays forms for inputs and data in tables. Every query can be saved to the GraphQL Editor Cloud, the same way the project schema is saved.

<figure><img src="https://2595489265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LkU3PZk9D4XQW0UI1bP%2Fuploads%2FSf8wUm4eYpy9fUbCMaaW%2Fimage.png?alt=media&#x26;token=41b8325a-2ac1-4c3a-87bd-40c0319a47a3" alt=""><figcaption><p>response in table format</p></figcaption></figure>

### Adding Parameters

If a query/mutation contains parameters they will be displayed as a form. This form can be customized which provides a better experience to the user than the classical gql console.

<figure><img src="https://2595489265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LkU3PZk9D4XQW0UI1bP%2Fuploads%2FgLV2LxBCHmggQQx4NhkB%2Fimage.png?alt=media&#x26;token=99e47dea-2d3e-425d-95aa-9bcbd705f0a5" alt=""><figcaption><p>write in or use dropdown to select parameters</p></figcaption></figure>

### Using widgets

Sometimes the type from GraphQL is not enough to provide the correct field to the user. Widgets provide different form fields for those situations.

<figure><img src="https://2595489265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LkU3PZk9D4XQW0UI1bP%2Fuploads%2FEoRnnjCnGCl3JNKsOrBH%2Fimage.png?alt=media&#x26;token=1ddb4e68-c4bf-47b3-bfd0-0cdb4aa06991" alt=""><figcaption><p>use built-in widgets or import them from a library</p></figcaption></figure>

#### Date Widget

This widget provides the date and the datetime inputs formatted to the desired format.

<figure><img src="https://2595489265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LkU3PZk9D4XQW0UI1bP%2Fuploads%2FUHpsctieU0Ql79d6HqnU%2Fimage.png?alt=media&#x26;token=21601bb6-66cd-4850-b4c2-24f4335d8175" alt=""><figcaption></figcaption></figure>

#### Password Widget

Same as text but masks the input.

#### Constant Widget

Always provides the same value for the field.

#### Text field Widget

Same as text input, but with a configurable label and placeholder.

#### Text box Widget

Displays `textarea` instead of `input` for strings longer than `input` field.

#### Relation Widget

This widget helps display relations in your schema. If for example, you have to select one of the objects of type **A** in your form but you need to prefetch them you should use a relation widget. For example:

```graphql
type Query{
  itemsByPerson(person: String): [Item!]
  people: [Person!]
}
type Item{
  name: String;
  owner: Person;
}
type Person{
  name: String;
  items: [Item!];
}
```

So for `itemsByPerson` input, you set  `Query.people`as a helper to fetch People to select inside `itemsByPerson`.

#### Autocomplete Widget

Autocomplete widget is better for `String` completions such as map addresses.

#### Upload widget

This widget helps upload the file via the standard S3 way:&#x20;

1. Perform a mutation to receive `putURL` `getURL` params
2. The widget will upload the file to the `putURL`&#x20;
3. It will return the file handle to the text input so it can be added to the object
