Create custom objects via metadata API
Hi, been trying to do this today. Struggling to find the correct mutation and input type. Is there any documentation around or can anyone provide an example query please?
8 Replies
Hello @James , you can access your graphql api playground through your workspace settings page
Also you can use extensions such as https://chromewebstore.google.com/detail/graphql-network-inspector/ndlbedplllcgconngcnfmkadhokfaaln in order to have a more human readable look to the cloud networks tabs ( allow easier query/mutation copy and vars copy too )
HItting plus after selecting add mutation

Selecting create one object in order to build your mutation from the UI api playground directly

Thanks for this. I was able to successfully create a custom object using this with just the mandatory input fields. However, when I try to run the exact same query using
curl (with Authorization: Bearer <API_KEY> and Content-Type: application/json), I get the following error:
{"errors":[{"message":"Unknown argument "input" on field "Mutation.createOneObject".","locations":[{"line":1,"column":40}]}]}
It seems curl is rejecting the input argument, even though the Playground accepts it. Any ideas why there's this
discrepancy or what I might be doing wrong with curl? Thanks!I would recommend hitting the REST api instead of the graphql one when using CURL
You can also have access to the REST api playground within your workspace settings
Great thanks - when creating a script to programmatically create multiple custom objects, any advice? Just getting errors at the moment
Not really unfortunately. You will be able to import and export twenty configurations by the end of Q3 ( allowing metadatas sync )
Ok great - thanks!