PluginsFlowoperations

Flow Operations

Package nameWeekly DownloadsVersionLicenseUpdated
@graphql-codegen/flow-operationsDownloadsVersionLicenseMay 26th, 2025

Installation

npm i -D @graphql-codegen/flow-operations
⚠️

Usage Requirements In order to use this GraphQL Codegen plugin, please make sure that you have GraphQL operations (query / mutation / subscription and fragment) set as documents: … in your codegen.yml.

Without loading your GraphQL operations (query, mutation, subscription and fragment), you won’t see any change in the generated output.

This plugin generates Flow types based on your GraphQLSchema and your GraphQL operations and fragments.

It generates types for your GraphQL documents: Query, Mutation, Subscription and Fragment.

This plugin requires you to use @graphql-codegen/flow as well, because it depends on its types.

Config API Reference

useFlowExactObjects

type: boolean default: true

Generates Flow types as Exact types.

Usage Examples

generates:
  path/to/file.js:
    plugins:
      - flow
      - flow-operations
    config:
      useFlowExactObjects: false

useFlowReadOnlyTypes

type: boolean default: false

Generates read-only Flow types

Usage Examples

generates:
  path/to/file.js:
    plugins:
      - flow
      - flow-operations
    config:
      useFlowReadOnlyTypes: true

flattenGeneratedTypes

type: boolean default: false

Flatten fragment spread and inline fragments into a simple selection set before generating.

Usage Examples

generates:
  path/to/file.js:
    plugins:
      - flow
      - flow-operations
    config:
      flattenGeneratedTypes: true