Skip to content

Latest commit

 

History

History
141 lines (105 loc) · 2.47 KB

settings.md

File metadata and controls

141 lines (105 loc) · 2.47 KB

Settings

  • Visit GraphQL Compose → Settings at /admin/config/graphql_compose/settings

Schema information

Schema information is located within the info query. You can customise what is returned by editing the SchemaInformation type.

query {
  info: SchemaInformation
}

type SchemaInformation {
  """
  A custom value for schema version.
  """
  version: String

  """
  Description of the schema.
  """
  description: String
}

Site information

Enable these fields to automatically pull configuration values.

  • Add site name
  • Add site slogan
  • Add home path
extend type SiteInformation {
  """
  The site name.
  """
  name: String

  """
  The site slogan.
  """
  slogan: String

  """
  The internal path to the front page.
  """
  home: String
}

Custom settings

Custom settings can be added to extend the info query.

  • You can create multiple values for a single field name by using the same field name.
  • You can use global tokens in the Value

Each setting you define will be available within the info query.

🤔 This can work well combining tokens with modules such as site_settings

Advanced settings

Expose entity IDs

The schema will always have UUIDs enabled. Exposing will allow loading entities by numeric id AND uuid.

For example:

Query

query {
  a: node(id: 1) {
    ... on NodeInterface {
      title
      id
      uuid
    }
  }

  b: node(id: "7321880a-93f8-4e98-85b9-0e40fd12c3da") {
    ... on NodeInterface {
      title
      id
      uuid
    }
  }
}

Result

{
  "data": {
    "a": {
      "title": "Home",
      "id": "1",
      "uuid": "7321880a-93f8-4e98-85b9-0e40fd12c3da"
    },
    "b": {
      "title": "Home",
      "id": "1",
      "uuid": "7321880a-93f8-4e98-85b9-0e40fd12c3da"
    }
  }
}

👻 This could open your schema up to enumeration attack and crawling.

Simple entity type unions

By default, the schema will use a common <entity type>Union for all entity references.

type NodePage {
  relatedNode: NodeUnion
}

union NodeUnion = NodePage | NodeArticle | NodeBasicPage

Disabling this option will create a separate union for each entity reference field, which is limited to the available target types.

type NodePage {
  relatedNode: NodePageRelatedNodeUnion
}

union NodePageRelatedNodeUnion = NodePage | NodeBasicPage