You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a issue in my microservice with use Hot Chocolate: when i try to expose the schema have problems because the filed service is not created and in the documentation i dont have information about that. this is the type City that i implement 👍
`public class CityType : ObjectType<Data.City>
{
protected override void Configure(IObjectTypeDescriptor<Data.City> descriptor)
{
descriptor.Field(x => x.Id).Type();
descriptor.Field(x => x.Code).Type();
descriptor.Field(x => x.CountryIso).Type();
descriptor.Field(x => x.SubdivisionIso).Type();
descriptor.Field(x => x.Name).Type();
descriptor.Field(x => x.Timezone).Type();
descriptor.ExtendServiceType<Data.City>();
}
}`
and startup:
services.AddGraphQLServer()
.AddType()
.AddQueryType()
.RegisterService<ICityService>();
Steps to reproduce
define a data model with the attributes with city
define a query class in c# this have one parameter IserviceCity ` public class CityQuery
{
[UseServiceScope]
[UsePaging(SchemaType = typeof(CityType))]
[UseSelection]
public async Task<List<Data.City>> GetAllCity([Service(ServiceKind.Synchronized)] ICityService cityService)
{
var listcities = await cityService.SelectAsync();
return listcities.Select(x => new Data.City() { Id = x.Id,Code=x.Code, CountryIso = x.CountryISO, Name = x.Name,SubdivisionIso= x.SubdivisionISO, Timezone=x.timezone }).ToList();
}
}`
3.create apollo gateway with apollo federetion in node js
Relevant log output
Error: Couldn't load service definitions for "cities" at http://localhost:58169/graphql: The field `_service` does not exist on the type `CityQuery`.
This discussion was converted from issue #5489 on October 28, 2022 21:45.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there an existing issue for this?
Describe the bug
I have a issue in my microservice with use Hot Chocolate: when i try to expose the schema have problems because the filed service is not created and in the documentation i dont have information about that. this is the type City that i implement 👍
`public class CityType : ObjectType<Data.City>
{
protected override void Configure(IObjectTypeDescriptor<Data.City> descriptor)
{
descriptor.Field(x => x.Id).Type();
descriptor.Field(x => x.Code).Type();
descriptor.Field(x => x.CountryIso).Type();
descriptor.Field(x => x.SubdivisionIso).Type();
descriptor.Field(x => x.Name).Type();
descriptor.Field(x => x.Timezone).Type();
descriptor.ExtendServiceType<Data.City>();
and startup:
services.AddGraphQLServer()
.AddType()
.AddQueryType()
.RegisterService<ICityService>();
Steps to reproduce
define a data model with the attributes with city
define a query class in c# this have one parameter IserviceCity ` public class CityQuery
{
[UseServiceScope]
[UsePaging(SchemaType = typeof(CityType))]
[UseSelection]
public async Task<List<Data.City>> GetAllCity([Service(ServiceKind.Synchronized)] ICityService cityService)
{
}`
3.create apollo gateway with apollo federetion in node js
Relevant log output
Error: Couldn't load service definitions for "cities" at http://localhost:58169/graphql: The field `_service` does not exist on the type `CityQuery`.
Additional Context?
No response
Product
Hot Chocolate
Version
12.15.0
Beta Was this translation helpful? Give feedback.
All reactions