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
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'Hot Chocolate GraphQL Pipeline'
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HN9S4N57VFC1", Request id "0HN9S4N57VFC1:00000003": An unhandled exception was thrown by the application.
Azure.DataApiBuilder.Service.Exceptions.DataApiBuilderException: No relationship exists between Character and Actor
at Azure.DataApiBuilder.Service.GraphQLBuilder.Sql.SchemaConverter.FindNullabilityOfRelationship(String entityName, DatabaseObject databaseObject, String targetEntityName) in /_/src/Service.GraphQLBuilder/Sql/SchemaConverter.cs:line 470
at Azure.DataApiBuilder.Service.GraphQLBuilder.Sql.SchemaConverter.GenerateFieldForRelationship(String entityName, DatabaseObject databaseObject, RuntimeEntities entities, String relationshipName, EntityRelationship relationship) in /_/src/Service.GraphQLBuilder/Sql/SchemaConverter.cs:line 276
at Azure.DataApiBuilder.Service.GraphQLBuilder.Sql.SchemaConverter.CreateObjectTypeDefinitionForTableOrView(String entityName, DatabaseObject databaseObject, Entity configEntity, RuntimeEntities entities, IEnumerable`1 rolesAllowedForEntity, IDictionary`2 rolesAllowedForFields) in /_/src/Service.GraphQLBuilder/Sql/SchemaConverter.cs:line 195
at Azure.DataApiBuilder.Service.GraphQLBuilder.Sql.SchemaConverter.GenerateObjectTypeDefinitionForDatabaseObject(String entityName, DatabaseObject databaseObject, Entity configEntity, RuntimeEntities entities, IEnumerable`1 rolesAllowedForEntity, IDictionary`2 rolesAllowedForFields) in /_/src/Service.GraphQLBuilder/Sql/SchemaConverter.cs:line 56
at Azure.DataApiBuilder.Core.Services.GraphQLSchemaCreator.GenerateSqlGraphQLObjects(RuntimeEntities entities, Dictionary`2 inputObjects) in /_/src/Core/Services/GraphQLSchemaCreator.cs:line 214
at Azure.DataApiBuilder.Core.Services.GraphQLSchemaCreator.GenerateGraphQLObjects() in /_/src/Core/Services/GraphQLSchemaCreator.cs:line 609
at Azure.DataApiBuilder.Core.Services.GraphQLSchemaCreator.InitializeSchemaAndResolvers(ISchemaBuilder schemaBuilder) in /_/src/Core/Services/GraphQLSchemaCreator.cs:line 155
at Azure.DataApiBuilder.Service.Startup.<>c.<AddGraphQLService>b__14_0(IServiceProvider serviceProvider, ISchemaBuilder schemaBuilder) in /_/src/Service/Startup.cs:line 237
at HotChocolate.Execution.RequestExecutorResolver.CreateSchemaAsync(NameString schemaName, RequestExecutorSetup options, RequestExecutorOptions executorOptions, IServiceProvider serviceProvider, TypeModuleChangeMonitor typeModuleChangeMonitor, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorResolver.CreateSchemaServicesAsync(NameString schemaN
Error message
No relationship exists between Character and Actor
There is a relationship between Character and Actor. This error is wrong.
Observation
There are TWO relationships. If I remove EITHER it starts working.
SET NOCOUNT ON
use [trek];
-- Create Login
IF NOT EXISTS (SELECT*FROMsys.server_principalsWHERE name ='DabLogin')
CREATE LOGIN [DabLogin] WITH PASSWORD ='P@ssw0rd!';
ALTER SERVER ROLE sysadmin ADD MEMBER [DabLogin];
-- Create User
IF NOT EXISTS (SELECT*FROMsys.database_principalsWHERE name ='DabUser')
CREATE USER [DabUser] FOR LOGIN [DabLogin];
EXEC sp_addrolemember 'db_owner', 'DabUser';
-- Drop tables in reverse order of creation due to foreign key dependenciesDROPTABLE IF EXISTS Character_Species;
DROPTABLE IF EXISTS Series_Character;
DROPTABLE IF EXISTS Character;
DROPTABLE IF EXISTS Species;
DROPTABLE IF EXISTS Actor;
DROPTABLE IF EXISTS Series;
-- create tablesCREATETABLESeries (
Id INTPRIMARY KEY,
Name NVARCHAR(255) NOT NULL
);
CREATETABLEActor (
Id INTPRIMARY KEY,
Name NVARCHAR(255) NOT NULL,
[BirthYear] INTNOT NULL
);
CREATETABLESpecies (
Id INTPRIMARY KEY,
Name NVARCHAR(255) NOT NULL
);
CREATETABLECharacter (
Id INTPRIMARY KEY,
Name NVARCHAR(255) NOT NULL,
ActorId INTNOT NULL,
Stardate DECIMAL(10, 2),
FOREIGN KEY (ActorId) REFERENCES Actor(Id)
);
CREATETABLESeries_Character (
SeriesId INT,
CharacterId INT,
Role VARCHAR(500),
FOREIGN KEY (SeriesId) REFERENCES Series(Id),
FOREIGN KEY (CharacterId) REFERENCES Character(Id),
PRIMARY KEY (SeriesId, CharacterId)
);
CREATETABLECharacter_Species (
CharacterId INT,
SpeciesId INT,
FOREIGN KEY (CharacterId) REFERENCES Character(Id),
FOREIGN KEY (SpeciesId) REFERENCES Species(Id),
PRIMARY KEY (CharacterId, SpeciesId)
);
The text was updated successfully, but these errors were encountered:
Query
Error
Error message
There is a relationship between Character and Actor. This error is wrong.
Observation
There are TWO relationships. If I remove EITHER it starts working.
Configuration
Database schema
The text was updated successfully, but these errors were encountered: