34. GraphQL Integration | Field Forge - Custom Fields, Built for Speed
Download Log in

34. GraphQL Integration

Developer Guide

Field Forge auto-registers native types and resolvers with WPGraphQL when the WPGraphQL plugin is active. WPGraphQL for ACF is not required. Resolvers read values from Field Forge tables, so migrated fields continue to work after ACF is deactivated.

Querying Fields via GraphQL

graphql
query GetProduct($id: ID!) {
  product(id: $id, idType: DATABASE_ID) {
    title
    fieldForgeProductFields {
      price
      saleBadge
      productGallery {
        databaseId
        sourceUrl
        mediaItemUrl
        altText
      }
      featuredProduct {
        __typename
        databaseId
        contentTypeName
        uri
      }
      specifications {
        label
        value
      }
    }
  }
}

GraphQL Type Mapping

Field Forge TypeGraphQL Type
text, textarea, email, url, passwordString
number, rangeFloat
true_falseBoolean
image, fileMediaItem
select, radio, button_groupString
checkbox[String]
gallery[MediaItem]
post_objectContentNode or [ContentNode] when multiple selection is enabled
relationship[ContentNode]
taxonomyTermNode or [TermNode] for checkbox / multi-select fields
user, page_linkString in the native resolver’s current scope
date_picker, time_picker, color_pickerString
repeaterCustom list type
groupCustom object type
flexible_contentCustom list type with acfFcLayout and layout sub-fields

Naming Rules

  • Each matching post type gets one field per Field Forge group: fieldForge + the group title in PascalCase. Example: Product Fields becomes fieldForgeProductFields.
  • Field names are converted from snake_case or kebab-case to camelCase. Example: hero_title becomes heroTitle.
  • Flexible Content exposes the layout name as acfFcLayout.
  • If two GraphQL names collide in the same object type, Field Forge appends a stable suffix from the field key or group ID.

Native resolvers cover scalar values, structured Group / Repeater / Flexible Content shapes, and object-backed fields. image, file, and gallery resolve to WPGraphQL MediaItem objects; post_object and relationship resolve to ContentNode; taxonomy resolves to TermNode. The same object mapping works inside nested Group, Repeater, and Flexible Content sub-fields.

For anonymous requests, Field Forge filters inaccessible private, draft, password-protected, or non-GraphQL post objects before returning them. Single object fields return null; list fields omit inaccessible nodes. Terms are returned only when their taxonomy is exposed to WPGraphQL.

Forge AI Assistant Online

Hi! I'm the Field Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs