コード例 #1
0
    public static ISchemaBuilder AddQueryFieldToMutationPayloads(this ISchemaBuilder schemaBuilder,
                                                                 Action <MutationPayloadOptions>?configureOptions = null)
    {
        MutationPayloadOptions options = new();

        configureOptions?.Invoke(options);

        return(schemaBuilder.AddQueryFieldToMutationPayloads(options));
    }
コード例 #2
0
    public static ISchemaBuilder EnableRelaySupport(
        this ISchemaBuilder schemaBuilder,
        RelayOptions?options = null)
    {
        options ??= new();

        if (options.AddQueryFieldToMutationPayloads)
        {
            MutationPayloadOptions payloadOptions = new()
            {
                QueryFieldName           = options.QueryFieldName,
                MutationPayloadPredicate = options.MutationPayloadPredicate
            };

            schemaBuilder.AddQueryFieldToMutationPayloads(payloadOptions);
        }

        return(schemaBuilder
               .SetContextData(IsRelaySupportEnabled, 1)
               .AddGlobalObjectIdentification());
    }