Skip to content

Separate schema and execution config #324

Closed
Closed
@namnm

Description

Right now the schema is also carry the execution config. For eg a schema is created as following:

var schema = Schema.Create(c =>{
    c.RegisterType(new QueryType());
    // TODO Register other types here

    // These configurations should be moved to another class for execution
    c.RegisterServiceProvider(new MyServiceProvider());
    c.Options.ExecutionTimeout = TimeSpan.FromSeconds(TIMEOUT);
    c.Options.DeveloperMode = DEVELOPMENT;
});

We should move the above config to another class, so the schema can be construct without the context (for eg ServiceProvider), and may be it can be stored statically as a singleton. Or we can modify the signature of Execute extension to take a service provider as a param.

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions