How to use the @graphql-codegen/flow.FlowOperationVariablesToObject function in @graphql-codegen/flow

To help you get started, we’ve selected a few @graphql-codegen/flow examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dotansimha / graphql-code-generator / packages / plugins / flow / resolvers / src / visitor.ts View on Github external
constructor(pluginConfig: FlowResolversPluginConfig, schema: GraphQLSchema) {
    super(pluginConfig, null, schema);
    autoBind(this);
    this.setVariablesTransformer(new FlowOperationVariablesToObject(this.scalars, this.convertName));
  }
github dotansimha / graphql-code-generator / packages / plugins / flow / operations / src / visitor.ts View on Github external
convertName: this.convertName.bind(this),
      enumPrefix: this.config.enumPrefix,
      scalars: this.scalars,
      formatNamedField: (name: string): string => name,
      wrapTypeWithModifiers,
    };
    const processor = config.preResolveTypes
      ? new PreResolveTypesProcessor(processorConfig)
      : new FlowWithPickSelectionSetProcessor({
          ...processorConfig,
          useFlowExactObjects: this.config.useFlowExactObjects,
          useFlowReadOnlyTypes: this.config.useFlowReadOnlyTypes,
        });
    const enumsNames = Object.keys(schema.getTypeMap()).filter(typeName => isEnumType(schema.getType(typeName)));
    this.setSelectionSetHandler(new SelectionSetToObject(processor, this.scalars, this.schema, this.convertName.bind(this), allFragments, this.config));
    this.setVariablesTransformer(new FlowOperationVariablesToObject(this.scalars, this.convertName.bind(this), this.config.namespacedImportName, enumsNames, this.config.enumPrefix));
  }
}

@graphql-codegen/flow

GraphQL Code Generator plugin for generating Flow types

MIT
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis

Popular @graphql-codegen/flow functions

Similar packages