Configuring the plugin
Configuring the pluginHiding Global Fields

Hiding Global Fields

Global fields are added to all types in the GraphQL schema, which renders its visualization unwieldy:

Schema with global fields exposed under all types

That's why the configuration (see next section) offers to not expose the global fields (when doing introspection), by either:

  • Exposing them on the Root type only
  • Not exposing them at all

Global fields will still available under all types from the schema, even when not exposed; in other words, they are simply "hidden from view" when doing introspection. If you desire to actually remove (not just hide) some global field from the schema, this must be done via an Access Control List.

By default, the schema exposes global fields under the Root type only, and it is easier to visualize and browse:

Schema with global fields exposed under the Root type only

Configuration

To select the general level of exposure of global fields in the GraphQL schema, go to the "Global Fields" module on the Settings page, and select the desired option:

  • Do not expose
  • Expose under the Root type only (this is the default value)
  • Expose under all types
Settings for Global Fields
Settings for Global Fields

To modify the exposure of global fields on different custom endpoints, select the desired option in block "Global Fields" when editing the corresponding Schema Configuration:

Editing Global Fields in the Schema Configuration