protected override void Configure(IObjectTypeDescriptor <AuthorDto> descriptor) { descriptor.Name("Author"); descriptor.Field(x => x.Id).Type <NonNullType <UuidType> >().Description("The id of the author."); descriptor.Field(x => x.Name).Type <NonNullType <StringType> >().Description("The name of the author."); descriptor.Field(x => x.Topics).Type <NonNullType <ListType <NonNullType <TopicType> > > >().Description("Topics of the author."); descriptor.IsOfType((context, result) => result is AuthorDto); }
protected override void Configure(IObjectTypeDescriptor <TopicDto> descriptor) { descriptor.Name("Topic"); descriptor.Field(x => x.Id).Type <NonNullType <UuidType> >().Description("The id of the topic."); descriptor.Field(x => x.Title).Type <NonNullType <StringType> >().Description("The title of the topic."); descriptor.Field(x => x.Description).Type <NonNullType <StringType> >().Description("The description of the topic"); descriptor.IsOfType((context, result) => result is TopicDto); }
protected override void Configure(IObjectTypeDescriptor descriptor) { descriptor.Name("Tea"); descriptor.Interface <DrinkType>(); descriptor.Field("kind") .Type <NonNullType <DrinkKindType> >() .Resolver(() => DrinkKind.BlackTea); descriptor.IsOfType((c, obj) => obj.Equals("black_tea")); }
protected override void Configure(IObjectTypeDescriptor descriptor) { descriptor.Name("Bar"); descriptor.Field("foo") .Type <NonNullType <FooType> >() .Resolver(() => "foo"); descriptor.Field("nameBar").Resolver(() => "bar"); descriptor.IsOfType((c, obj) => obj.Equals("bar")); }
protected override void Configure(IObjectTypeDescriptor <Error> descriptor) { descriptor.Name("Error"); descriptor.Field(x => x.ErrorMessage).Type <NonNullType <StringType> >().Description("Error message."); descriptor.IsOfType((context, result) => result is Error); }