Version: unstable
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation gateConfigurationCreate($input: GateConfigurationCreateInput!) { gateConfigurationCreate(input: $input) { userErrors { field message } gateConfiguration { id name handle createdAt updatedAt } } }\",\n \"variables\": {\n \"input\": {\n \"name\": \"My first gate\",\n \"handle\": \"gate_from_app\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation gateConfigurationCreate($input: GateConfigurationCreateInput!) {\n gateConfigurationCreate(input: $input) {\n userErrors {\n field\n message\n }\n gateConfiguration {\n id\n name\n handle\n createdAt\n updatedAt\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"name\": \"My first gate\",\n \"handle\": \"gate_from_app\"\n }\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation gateConfigurationCreate($input: GateConfigurationCreateInput!) {\n gateConfigurationCreate(input: $input) {\n userErrors {\n field\n message\n }\n gateConfiguration {\n id\n name\n handle\n createdAt\n updatedAt\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"name\": \"My first gate\",\n \"handle\": \"gate_from_app\"\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<[\n \"name\" => \"My first gate\",\n \"handle\" => \"gate_from_app\",\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation gateConfigurationCreate($input: GateConfigurationCreateInput!) {\n gateConfigurationCreate(input: $input) {\n userErrors {\n field\n message\n }\n gateConfiguration {\n id\n name\n handle\n createdAt\n updatedAt\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"name\": \"My first gate\",\n \"handle\": \"gate_from_app\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation gateConfigurationCreate($input: GateConfigurationCreateInput!) {\n gateConfigurationCreate(input: $input) {\n userErrors {\n field\n message\n }\n gateConfiguration {\n id\n name\n handle\n createdAt\n updatedAt\n }\n }\n}"
input: { "input": { "name": "My first gate", "handle": "gate_from_app" } }
response: { "data": { "gateConfigurationCreate": { "userErrors": [], "gateConfiguration": { "id": "gid://shopify/GateConfiguration/589189058", "name": "My first gate", "handle": "gate_from_app", "createdAt": "2024-09-12T01:10:12Z", "updatedAt": "2024-09-12T01:10:12Z" } } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation gateConfigurationCreate($input: GateConfigurationCreateInput!) { gateConfigurationCreate(input: $input) { userErrors { field message } gateConfiguration { id name handle requirements: metafield(namespace: \\\"myapp\\\", key: \\\"requirements\\\") { id type value description } reactions: metafield(namespace: \\\"myapp\\\", key: \\\"reactions\\\") { id type value description } createdAt updatedAt } } }\",\n \"variables\": {\n \"input\": {\n \"name\": \"My first gate\",\n \"handle\": \"gate_from_app\",\n \"metafields\": [\n {\n \"key\": \"reactions\",\n \"namespace\": \"myapp\",\n \"description\": \"My first gate reaction\",\n \"type\": \"json\",\n \"value\": \"{\\\"reactions\\\": \\\"test\\\"}\"\n },\n {\n \"key\": \"requirements\",\n \"namespace\": \"myapp\",\n \"description\": \"My first gate requirement\",\n \"type\": \"json\",\n \"value\": \"{\\\"requirements\\\": \\\"test\\\"}\"\n }\n ]\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation gateConfigurationCreate($input: GateConfigurationCreateInput!) {\n gateConfigurationCreate(input: $input) {\n userErrors {\n field\n message\n }\n gateConfiguration {\n id\n name\n handle\n requirements: metafield(namespace: \"myapp\", key: \"requirements\") {\n id\n type\n value\n description\n }\n reactions: metafield(namespace: \"myapp\", key: \"reactions\") {\n id\n type\n value\n description\n }\n createdAt\n updatedAt\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"name\": \"My first gate\",\n \"handle\": \"gate_from_app\",\n \"metafields\": [\n {\n \"key\": \"reactions\",\n \"namespace\": \"myapp\",\n \"description\": \"My first gate reaction\",\n \"type\": \"json\",\n \"value\": \"{\\\"reactions\\\": \\\"test\\\"}\"\n },\n {\n \"key\": \"requirements\",\n \"namespace\": \"myapp\",\n \"description\": \"My first gate requirement\",\n \"type\": \"json\",\n \"value\": \"{\\\"requirements\\\": \\\"test\\\"}\"\n }\n ]\n }\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation gateConfigurationCreate($input: GateConfigurationCreateInput!) {\n gateConfigurationCreate(input: $input) {\n userErrors {\n field\n message\n }\n gateConfiguration {\n id\n name\n handle\n requirements: metafield(namespace: \"myapp\", key: \"requirements\") {\n id\n type\n value\n description\n }\n reactions: metafield(namespace: \"myapp\", key: \"reactions\") {\n id\n type\n value\n description\n }\n createdAt\n updatedAt\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"name\": \"My first gate\",\n \"handle\": \"gate_from_app\",\n \"metafields\": [{\"key\"=>\"reactions\", \"namespace\"=>\"myapp\", \"description\"=>\"My first gate reaction\", \"type\"=>\"json\", \"value\"=>\"{\\\"reactions\\\": \\\"test\\\"}\"}, {\"key\"=>\"requirements\", \"namespace\"=>\"myapp\", \"description\"=>\"My first gate requirement\", \"type\"=>\"json\", \"value\"=>\"{\\\"requirements\\\": \\\"test\\\"}\"}]\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<[\n \"name\" => \"My first gate\",\n \"handle\" => \"gate_from_app\",\n \"metafields\" => [{\"key\"=>\"reactions\", \"namespace\"=>\"myapp\", \"description\"=>\"My first gate reaction\", \"type\"=>\"json\", \"value\"=>\"{\\\"reactions\\\": \\\"test\\\"}\"}, {\"key\"=>\"requirements\", \"namespace\"=>\"myapp\", \"description\"=>\"My first gate requirement\", \"type\"=>\"json\", \"value\"=>\"{\\\"requirements\\\": \\\"test\\\"}\"}],\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation gateConfigurationCreate($input: GateConfigurationCreateInput!) {\n gateConfigurationCreate(input: $input) {\n userErrors {\n field\n message\n }\n gateConfiguration {\n id\n name\n handle\n requirements: metafield(namespace: \"myapp\", key: \"requirements\") {\n id\n type\n value\n description\n }\n reactions: metafield(namespace: \"myapp\", key: \"reactions\") {\n id\n type\n value\n description\n }\n createdAt\n updatedAt\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"name\": \"My first gate\",\n \"handle\": \"gate_from_app\",\n \"metafields\": [\n {\n \"key\": \"reactions\",\n \"namespace\": \"myapp\",\n \"description\": \"My first gate reaction\",\n \"type\": \"json\",\n \"value\": \"{\\\"reactions\\\": \\\"test\\\"}\"\n },\n {\n \"key\": \"requirements\",\n \"namespace\": \"myapp\",\n \"description\": \"My first gate requirement\",\n \"type\": \"json\",\n \"value\": \"{\\\"requirements\\\": \\\"test\\\"}\"\n }\n ]\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation gateConfigurationCreate($input: GateConfigurationCreateInput!) {\n gateConfigurationCreate(input: $input) {\n userErrors {\n field\n message\n }\n gateConfiguration {\n id\n name\n handle\n requirements: metafield(namespace: \"myapp\", key: \"requirements\") {\n id\n type\n value\n description\n }\n reactions: metafield(namespace: \"myapp\", key: \"reactions\") {\n id\n type\n value\n description\n }\n createdAt\n updatedAt\n }\n }\n}"
input: { "input": { "name": "My first gate", "handle": "gate_from_app", "metafields": [ { "key": "reactions", "namespace": "myapp", "description": "My first gate reaction", "type": "json", "value": "{\"reactions\": \"test\"}" }, { "key": "requirements", "namespace": "myapp", "description": "My first gate requirement", "type": "json", "value": "{\"requirements\": \"test\"}" } ] } }
response: { "data": { "gateConfigurationCreate": { "userErrors": [], "gateConfiguration": { "id": "gid://shopify/GateConfiguration/589189057", "name": "My first gate", "handle": "gate_from_app", "requirements": { "id": "gid://shopify/Metafield/1069229084", "type": "json", "value": "{\"requirements\":\"test\"}", "description": "My first gate requirement" }, "reactions": { "id": "gid://shopify/Metafield/1069229083", "type": "json", "value": "{\"reactions\":\"test\"}", "description": "My first gate reaction" }, "createdAt": "2024-09-12T01:10:11Z", "updatedAt": "2024-09-12T01:10:11Z" } } } }