Skip to content

Instantly share code, notes, and snippets.

View PascalSenn's full-sized avatar
🌶️

PascalSenn

🌶️
View GitHub Profile

FAQ

How to..

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

@PascalSenn
PascalSenn / Program.cs
Last active August 26, 2021 10:57
Print Schema with Args
public class Program
{
public static async Task Main(string[] args)
{
IHost? host = CreateHostBuilder(args).Build();
if (args.Contains("--generate-schema"))
{
IRequestExecutor executor = await host.Services
.GetRequiredService<IRequestExecutorResolver>()
.GetRequestExecutorAsync();
@PascalSenn
PascalSenn / data-next.cs
Created February 9, 2022 20:46
Data Next
public class Person
{
public string FirstName { get; }
public string LastName { get; }
}
[ExtendObjectType(typeof(Person))]
public class PersonExtension
{
if (argument.Type is IFilterInputType filterInput &&
context.Selection.Field.ContextData
.TryGetValue(ContextVisitFilterArgumentKey, out var executorObj) &&
executorObj is VisitFilterArgument executor)
{
var inMemory = IsInMemoryQuery<TEntityType>(input);
var visitorContext = executor(filter, filterInput, inMemory);
// compile expression tree

As we develop the composite schema specification, we must decide what belongs in the core specification and what should be defined as an extension. Whatever we include in the core specification becomes mandatory for all compliant implementations. If the core spec becomes too large or complicated, it can hinder adoption-especially for teams that do not need advanced governance or collaboration features.

Minimal Executable Composite Schema

Consider the smallest example of a composite schema that can be resolved by an executor. Suppose we have two sub-schemas:

type Product {