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) {
hash
name
size
}
}
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": {
"hash": "QmYx8C3kNN1sFSx5b...",
"name": "thing.json",
"size": 256
}
}
}
Workflowβ
- Pin metadata using
pinThingmutation - Get IPFS hash from response
- Create atom on-chain using the hash
- Query the atom via GraphQL API
Best Practicesβ
- Upload images first if needed using
uploadImage - Include all metadata fields for rich display
- Store IPFS hash for future reference
- Wait for indexing before querying the atom