How to use the @graphql-codegen/visitor-plugin-common.wrapWithSingleQuotes function in @graphql-codegen/visitor-plugin-common

To help you get started, we’ve selected a few @graphql-codegen/visitor-plugin-common 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 / typescript / typescript / src / visitor.ts View on Github external
.map(enumOption => {
                let enumValue: string = (enumOption.name as any) as string;
                const comment = transformComment((enumOption.description as any) as string, 1);

                if (this.config.enumValues[enumName] && this.config.enumValues[enumName].mappedValues && this.config.enumValues[enumName].mappedValues[enumValue]) {
                  enumValue = this.config.enumValues[enumName].mappedValues[enumValue];
                }

                return comment + indent(wrapWithSingleQuotes(enumValue));
              })
              .join(' |\n')
github dotansimha / graphql-code-generator / packages / plugins / flow / flow / src / visitor.ts View on Github external
.map(enumOption => {
            const comment = transformComment((enumOption.description as any) as string, 1);
            const optionName = this.convertName(enumOption, { transformUnderscore: true, useTypesPrefix: false });
            let enumValue: string = (enumOption.name as any) as string;

            if (this.config.enumValues[typeName] && this.config.enumValues[typeName].mappedValues && this.config.enumValues[typeName].mappedValues[enumValue]) {
              enumValue = this.config.enumValues[typeName].mappedValues[enumValue];
            }

            return comment + indent(`${optionName}: ${wrapWithSingleQuotes(enumValue)}`);
          })
          .join(', \n')