Loading...
Loading...
Core resources in Quiltt can be easily extended with additional custom information, using the metadata
field.
The metadata
field allows you to store arbitrary custom data in a structured manner. You can use this to store many types of static or dynamic information that may be useful to retrieve later. Below are some examples:
The following resources currently expose a metadata
field via corresponding GraphQL mutations:
Resource | GraphQL Mutation |
---|---|
Profile | profileUpdate |
Connection | connectionUpdate |
Account | accountUpdate |
Transaction | transactionUpdate |
Additionally, Profile metadata
can also be managed using the below server-to-server endpoints:
POSThttps://api.quiltt.io/v1/users/sessions
POSThttps://api.quiltt.io/v1/profiles
PATCHhttps://api.quiltt.io/v1/profiles/{profileId}
The best way to interact with metadata is by using the GraphQL explorer in the Quiltt Dashboard, or Quiltt Hub.
For this example, we'll assume we have a Profile named Quiltty, then add and remove some metadata.
First we'll assign some internal identifiers to track via metadata
.
Let's say we've learned that Quiltty's favorite color is purple. We can reflect that on the Profile by adding that data to metadata
:
Note that the existing metadata
keys are not touched unless they're explicitly set in the request.
Now let's say we've migrated off of Firebase. To delete the metadata
entry, we can simply set the key to null
:
To clear metadata
entirely, we can set all the defined keys to null
or the entire metadata object to null
.
In GraphQL, you can filter records by the contents of the metadata
field.
For example, here's how you can query Connections by an internal identifier you've written to a Connection's metadata
.
Similarly, you can filter for records without any metadata by suppyling metadata: null
to the filter.
Custom metadata must be sent as a valid key-value JSON object, and must include at least 1 string key. There is a maximum capacity of 50 keys per record, with key names limited to 50 characters and values limited to 500 characters.
You should avoid storing any sensitive data that may contain PII. in the metadata
object. If you need to store sensitive data like emails, phone numbers or birthdays, use the dedicated fields on the Profile, which provide an additional level of encryption, as explained in the Core Concepts guide.