Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make descriptor default binding behavior explicit #918

Closed
glucaci opened this issue Jul 17, 2019 · 1 comment · Fixed by #963
Closed

Make descriptor default binding behavior explicit #918

glucaci opened this issue Jul 17, 2019 · 1 comment · Fixed by #963
Milestone

Comments

@glucaci
Copy link
Contributor

glucaci commented Jul 17, 2019

Currently when a InputObjectType or ObjectType is described, must always set BindingBehavior.Explicit

public class MyInputType : InputObjectType<MyInput>
{
    protected override void Configure(
        IInputObjectTypeDescriptor<MyInput> descriptor)
    {
        descriptor.BindFields(BindingBehavior.Explicit);
        
        // .. configure
    }
}

If this is not set, all the properties of the given type will be exposed.

It will be much "explicit" to have as default BindingBehavior.Explicit and possibility to switch on BindingBehavior.Implicit by registering the appropriate convention.

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<IBindingConventions, ImplicitBindingConvention>();
}

or more user friendly

public void ConfigureServices(IServiceCollection services)
{
    services.AddImplicitBindingConvention();
}
@michaelstaib
Copy link
Member

This one is not implemented.... the default binding can be specified as a schema option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants