How to use the @graphql-codegen/java-common.wrapTypeWithModifiers function in @graphql-codegen/java-common

To help you get started, we’ve selected a few @graphql-codegen/java-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 / java / kotlin / src / visitor.ts View on Github external
} else if (isInputObjectType(schemaType)) {
      result = {
        baseType: `${this.convertName(schemaType.name)}Input`,
        typeName: `${this.convertName(schemaType.name)}Input`,
        isScalar: false,
        isArray,
        nullable: nullable,
      };
    } else if (isEnumType(schemaType)) {
      result = { isArray, baseType: this.convertName(schemaType.name), typeName: this.convertName(schemaType.name), isScalar: true, nullable: nullable };
    } else {
      result = { isArray, baseType: 'Any', typeName: 'Any', isScalar: true, nullable: nullable };
    }

    if (result) {
      result.typeName = wrapTypeWithModifiers(result.typeName, typeNode, this.config.listType);
    }

    return result;
  }
github dotansimha / graphql-code-generator / packages / plugins / java / java / src / visitor.ts View on Github external
}
    } else if (isInputObjectType(schemaType)) {
      result = {
        baseType: `${this.convertName(schemaType.name)}Input`,
        typeName: `${this.convertName(schemaType.name)}Input`,
        isScalar: false,
        isArray,
      };
    } else if (isEnumType(schemaType)) {
      result = { isArray, baseType: this.convertName(schemaType.name), typeName: this.convertName(schemaType.name), isScalar: true };
    } else {
      result = { isArray, baseType: 'Object', typeName: 'Object', isScalar: true };
    }

    if (result) {
      result.typeName = wrapTypeWithModifiers(result.typeName, typeNode, this.config.listType);
    }

    return result;
  }
github dotansimha / graphql-code-generator / packages / plugins / java / resolvers / src / visitor.ts View on Github external
return (isInterface: boolean) => {
      const baseType = getBaseTypeNode(node.type);
      const typeToUse = this.getTypeToUse(baseType);
      const wrappedType = wrapTypeWithModifiers(typeToUse, node.type, this.config.listType);

      if (isInterface) {
        return `default public DataFetcher<${wrappedType}> ${node.name.value}() { return null; }`;
      } else {
        return `public DataFetcher<${wrappedType}> ${node.name.value}();`;
      }
    };
  }

@graphql-codegen/java-common

GraphQL Code Generator utils library for developing Java plugins

MIT
Latest version published 1 year ago

Package Health Score

61 / 100
Full package analysis

Similar packages