How to use the apollo-codegen-core/lib/compiler/visitors/typeCase.typeCaseForSelectionSet function in apollo-codegen-core

To help you get started, we’ve selected a few apollo-codegen-core 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 apollographql / apollo-tooling / packages / apollo-codegen-flow / src / codeGeneration.ts View on Github external
private getTypeCasesForSelectionSet(selectionSet: SelectionSet) {
    return typeCaseForSelectionSet(
      selectionSet,
      this.context.options.mergeInFieldsFromFragmentSpreads
    );
  }
github apollographql / apollo-tooling / packages / apollo-codegen-swift / src / codeGeneration.ts View on Github external
structDeclarationForSelectionSet(
    {
      structName,
      adoptedProtocols = ["GraphQLSelectionSet"],
      selectionSet
    }: {
      structName: string;
      adoptedProtocols?: string[];
      selectionSet: SelectionSet;
    },
    outputIndividualFiles: boolean,
    before?: Function
  ) {
    const typeCase = typeCaseForSelectionSet(
      selectionSet,
      !!this.context.options.mergeInFieldsFromFragmentSpreads
    );

    this.structDeclarationForVariant(
      {
        structName,
        adoptedProtocols,
        variant: typeCase.default,
        typeCase
      },
      outputIndividualFiles,
      before,
      () => {
        const variants = typeCase.variants.map(
          this.helpers.propertyFromVariant,
github apollographql / apollo-tooling / packages / apollo-codegen-typescript / src / codeGeneration.ts View on Github external
private getTypeCasesForSelectionSet(selectionSet: SelectionSet) {
    return typeCaseForSelectionSet(
      selectionSet,
      this.context.options.mergeInFieldsFromFragmentSpreads
    );
  }