示例#1
0
 protected override IObjectFieldDescriptor ConfigureNodeField()
 {
     return(Definition.IdMember is null
         ? MiddlewareHelper.TryAdd(
                _typeDescriptor
                .Field(NodeType.Names.Id)
                .Type <NonNullType <IdType> >())
         : MiddlewareHelper.TryAdd(
                _typeDescriptor
                .Field(Definition.IdMember)
                .Name(NodeType.Names.Id)
                .Type <NonNullType <IdType> >()));
 }
示例#2
0
 internal void ConfigureNodeField(IObjectTypeDescriptor typeDescriptor)
 {
     if (Definition.IdMember is null)
     {
         MiddlewareHelper.TryAdd(
             typeDescriptor
             .Field(NodeType.Names.Id)
             .Type <NonNullType <IdType> >());
     }
     else
     {
         MiddlewareHelper.TryAdd(
             typeDescriptor
             .Field(Definition.IdMember)
             .Name(NodeType.Names.Id)
             .Type <NonNullType <IdType> >());
     }
 }
示例#3
0
        protected override IObjectFieldDescriptor ConfigureNodeField()
        {
            Definition.NodeType = typeof(TNode);

            if (Definition.IdMember is null)
            {
                Definition.IdMember = Context.TypeInspector.GetNodeIdMember(typeof(TNode));
            }

            return(Definition.IdMember is null
                ? MiddlewareHelper.TryAdd(
                       _typeDescriptor
                       .Field(NodeType.Names.Id)
                       .Type <NonNullType <IdType> >())
                : MiddlewareHelper.TryAdd(
                       _typeDescriptor
                       .Field(Definition.IdMember)
                       .Name(NodeType.Names.Id)
                       .Type <NonNullType <IdType> >()));
        }