# GateConfiguration - admin-graphql - OBJECT
Version: unstable

## Description
Represents a gate configuration, which stores the information about a gate.
A gate configuration can be bound to multiple subjects via the [GateSubject](https://shopify.dev/api/admin-graphql/unstable/objects/GateSubject) model.

### Access Scopes
`read_gates` access scope. Also: You must have read access to `gates` to read gate configurations.



## Fields
* [appId](/docs/api/admin-graphql/unstable/scalars/String): String - An ID that an owner can use to identify the gate configuration.
* [createdAt](/docs/api/admin-graphql/unstable/scalars/DateTime): DateTime! - The date and time when the gate configuration was created.
* [defaultCursor](/docs/api/admin-graphql/unstable/scalars/String): String! - A default [cursor](https://shopify.dev/api/usage/pagination-graphql) that returns the single next record, sorted ascending by ID.
* [handle](/docs/api/admin-graphql/unstable/scalars/String): String - A non-unique string used to group gate configurations.
* [id](/docs/api/admin-graphql/unstable/scalars/ID): ID! - The ID of the gate configuration.
* [metafield](/docs/api/admin-graphql/unstable/objects/Metafield): Metafield - A [custom field](https://shopify.dev/docs/apps/build/custom-data),
including its `namespace` and `key`, that's associated with a Shopify resource
for the purposes of adding and storing additional information.
* [metafieldsByIdentifiers](/docs/api/admin-graphql/unstable/objects/Metafield): Metafield! - The metafields associated with the resource matching the supplied list of namespaces and keys.
* [name](/docs/api/admin-graphql/unstable/scalars/String): String - The name of the gate configuration.
* [updatedAt](/docs/api/admin-graphql/unstable/scalars/DateTime): DateTime! - The date and time when the gate configuration was updated.

## Connections
* [metafields](/docs/api/admin-graphql/unstable/connections/MetafieldConnection): MetafieldConnection!
* [subjectBindings](/docs/api/admin-graphql/unstable/connections/GateSubjectConnection): GateSubjectConnection!



## Related queries
* [gateConfiguration](/docs/api/admin-graphql/unstable/queries/gateConfiguration) Fetch a gate configuration resource by ID.
* [gateConfigurations](/docs/api/admin-graphql/unstable/queries/gateConfigurations) List of the shop's gate configurations.

## Related mutations
* [gateConfigurationCreate](/docs/api/admin-graphql/unstable/mutations/gateConfigurationCreate) Create a new gate configuration.
* [gateConfigurationUpdate](/docs/api/admin-graphql/unstable/mutations/gateConfigurationUpdate) Update a gate configuration.

## Related Unions

## Examples
### Get a gate configuration by ID
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\": \"query gateConfiguration($id: ID!) { gateConfiguration(id: $id) { id } }\",\n \"variables\": {\n    \"id\": \"gid://shopify/GateConfiguration/43548663\"\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `query gateConfiguration($id: ID!) {\n      gateConfiguration(id: $id) {\n        id\n      }\n    }`,\n    \"variables\": {\n      \"id\": \"gid://shopify/GateConfiguration/43548663\"\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  query gateConfiguration($id: ID!) {\n    gateConfiguration(id: $id) {\n      id\n    }\n  }\nQUERY\n\nvariables = {\n  \"id\": \"gid://shopify/GateConfiguration/43548663\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  query gateConfiguration($id: ID!) {\n    gateConfiguration(id: $id) {\n      id\n    }\n  }`,\n  {\n    variables: {\n      \"id\": \"gid://shopify/GateConfiguration/43548663\"\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "query gateConfiguration($id: ID!) {\n  gateConfiguration(id: $id) {\n    id\n  }\n}"
#### Graphql Input
{
  "id": "gid://shopify/GateConfiguration/43548663"
}
#### Graphql Response
{
  "data": {
    "gateConfiguration": {
      "id": "gid://shopify/GateConfiguration/43548663"
    }
  }
}

### Get all gate configurations fields and connections
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\": \"query gateConfiguration($id: ID!) { gateConfiguration(id: $id) { id name appId reactions: metafield(namespace: \\\"myapp\\\", key: \\\"reactions\\\") { id type value description } createdAt updatedAt } }\",\n \"variables\": {\n    \"id\": \"gid://shopify/GateConfiguration/43548663\"\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `query gateConfiguration($id: ID!) {\n      gateConfiguration(id: $id) {\n        id\n        name\n        appId\n        reactions: metafield(namespace: \"myapp\", key: \"reactions\") {\n          id\n          type\n          value\n          description\n        }\n        createdAt\n        updatedAt\n      }\n    }`,\n    \"variables\": {\n      \"id\": \"gid://shopify/GateConfiguration/43548663\"\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  query gateConfiguration($id: ID!) {\n    gateConfiguration(id: $id) {\n      id\n      name\n      appId\n      reactions: metafield(namespace: \"myapp\", key: \"reactions\") {\n        id\n        type\n        value\n        description\n      }\n      createdAt\n      updatedAt\n    }\n  }\nQUERY\n\nvariables = {\n  \"id\": \"gid://shopify/GateConfiguration/43548663\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  query gateConfiguration($id: ID!) {\n    gateConfiguration(id: $id) {\n      id\n      name\n      appId\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      \"id\": \"gid://shopify/GateConfiguration/43548663\"\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "query gateConfiguration($id: ID!) {\n  gateConfiguration(id: $id) {\n    id\n    name\n    appId\n    reactions: metafield(namespace: \"myapp\", key: \"reactions\") {\n      id\n      type\n      value\n      description\n    }\n    createdAt\n    updatedAt\n  }\n}"
#### Graphql Input
{
  "id": "gid://shopify/GateConfiguration/43548663"
}
#### Graphql Response
{
  "data": {
    "gateConfiguration": {
      "id": "gid://shopify/GateConfiguration/43548663",
      "name": "test tokengate",
      "appId": "test-tokengate",
      "reactions": null,
      "createdAt": "2024-09-12T01:05:24Z",
      "updatedAt": "2024-09-12T01:05:24Z"
    }
  }
}

### Get gateSubjects for a gate configuration
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\": \"query gateConfiguration($id: ID!) { gateConfiguration(id: $id) { id name appId metafields(namespace: \\\"myapp\\\", first: 10) { nodes { key namespace description type value } } createdAt updatedAt subjectBindings(first: 10) { nodes { id } } } }\",\n \"variables\": {\n    \"id\": \"gid://shopify/GateConfiguration/43548663\"\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `query gateConfiguration($id: ID!) {\n      gateConfiguration(id: $id) {\n        id\n        name\n        appId\n        metafields(namespace: \"myapp\", first: 10) {\n          nodes {\n            key\n            namespace\n            description\n            type\n            value\n          }\n        }\n        createdAt\n        updatedAt\n        subjectBindings(first: 10) {\n          nodes {\n            id\n          }\n        }\n      }\n    }`,\n    \"variables\": {\n      \"id\": \"gid://shopify/GateConfiguration/43548663\"\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  query gateConfiguration($id: ID!) {\n    gateConfiguration(id: $id) {\n      id\n      name\n      appId\n      metafields(namespace: \"myapp\", first: 10) {\n        nodes {\n          key\n          namespace\n          description\n          type\n          value\n        }\n      }\n      createdAt\n      updatedAt\n      subjectBindings(first: 10) {\n        nodes {\n          id\n        }\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"id\": \"gid://shopify/GateConfiguration/43548663\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  query gateConfiguration($id: ID!) {\n    gateConfiguration(id: $id) {\n      id\n      name\n      appId\n      metafields(namespace: \"myapp\", first: 10) {\n        nodes {\n          key\n          namespace\n          description\n          type\n          value\n        }\n      }\n      createdAt\n      updatedAt\n      subjectBindings(first: 10) {\n        nodes {\n          id\n        }\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"id\": \"gid://shopify/GateConfiguration/43548663\"\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "query gateConfiguration($id: ID!) {\n  gateConfiguration(id: $id) {\n    id\n    name\n    appId\n    metafields(namespace: \"myapp\", first: 10) {\n      nodes {\n        key\n        namespace\n        description\n        type\n        value\n      }\n    }\n    createdAt\n    updatedAt\n    subjectBindings(first: 10) {\n      nodes {\n        id\n      }\n    }\n  }\n}"
#### Graphql Input
{
  "id": "gid://shopify/GateConfiguration/43548663"
}
#### Graphql Response
{
  "data": {
    "gateConfiguration": {
      "id": "gid://shopify/GateConfiguration/43548663",
      "name": "test tokengate",
      "appId": "test-tokengate",
      "metafields": {
        "nodes": [
          {
            "key": "requirements",
            "namespace": "myapp",
            "description": null,
            "type": "json_string",
            "value": "{\"requirements\": \"test\"}"
          }
        ]
      },
      "createdAt": "2024-09-12T01:05:24Z",
      "updatedAt": "2024-09-12T01:05:24Z",
      "subjectBindings": {
        "nodes": [
          {
            "id": "gid://shopify/GateSubject/397454785"
          }
        ]
      }
    }
  }
}