How to use the graphql-transformer-core.getFieldArguments function in graphql-transformer-core

To help you get started, we’ve selected a few graphql-transformer-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 aws-amplify / amplify-cli / packages / graphql-auth-transformer / src / ModelAuthTransformer.ts View on Github external
private addOwner(ctx: TransformerContext, parent: string) {
        const modelType: any = ctx.getType(parent);
        const fields = getFieldArguments(modelType);
        if (!("owner" in fields)) {
            modelType.fields.push(
                makeField(
                    DEFAULT_OWNER_FIELD,
                    [],
                    makeNamedType('String'),
                )
            )
        }
        ctx.putType(modelType);
    }