Pin Thing Mutation
Pin a "Thing" object (general entity) to IPFS for use in atom creation.
Mutation Structureβ
mutation PinThing($thing: PinThingInput!) {
pinThing(thing: $thing) {
uri
}
}
Variablesβ
{
"thing": {
"name": "TypeScript Programming Language",
"description": "A strongly typed programming language that builds on JavaScript",
"image": "ipfs://QmXnnyufdzAWL5CqZ2RnSNgPbvCc1ALT73s6epPrRnZ1Xy",
"url": "https://www.typescriptlang.org"
}
}
Responseβ
{
"data": {
"pinThing": {
"uri": "ipfs://QmYx8C3kNN1sFSx5b..."
}
}
}
Workflowβ
- Pin metadata using
pinThingmutation - Get IPFS URI from response
- Create atom on-chain using the URI
- Query the atom via GraphQL API
Best Practicesβ
- Upload images first if needed using
uploadImage - Include all metadata fields for rich display
- Store IPFS URI for future reference
- Wait for indexing before querying the atom