public static IStitchingBuilder AddSchemaFromLocal(this IStitchingBuilder stitchingBuilder, string serviceName, ISchemaBuilder schemaBuilder, IWebHostEnvironment env, IServiceCollection services) { var schemaName = $"AG_{serviceName}"; stitchingBuilder.AddQueryExecutor(schemaName, sp => schemaBuilder.AddServices(sp).Create().MakeExecutable()); // Add extensions (for types that get stitched in from this service) stitchingBuilder.AddExtensionsFromFileForService(serviceName, env); return(stitchingBuilder); }
public static IStitchingBuilder AddSchema( this IStitchingBuilder builder, NameString name, ISchema schema) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } if (schema == null) { throw new ArgumentNullException(nameof(schema)); } name.EnsureNotEmpty(nameof(name)); builder.AddQueryExecutor(name, s => schema.MakeExecutable()); return(builder); }