Browse Source

GraphQL fixed.

pull/587/head
Sebastian 5 years ago
parent
commit
6acd842fb2
  1. 14
      backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs
  2. 6
      backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs
  3. 18
      backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs
  4. 2
      backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj
  5. 2
      backend/src/Squidex/Squidex.csproj
  6. 4
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj
  7. 2
      frontend/app/shared/components/app-form.component.html

14
backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs

@ -84,16 +84,20 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL
{
var schema = new GraphQLSchema
{
Query =
new AppQueriesGraphType(
Query = new AppQueriesGraphType(
model,
pageSizeContents,
pageSizeAssets,
schemas
),
Mutation = new AppMutationsGraphType(model, schemas)
schemas)
};
var schemasWithFields = schemas.Where(x => x.SchemaDef.Fields.Count > 0);
if (schemasWithFields.Any())
{
schema.Mutation = new AppMutationsGraphType(model, schemasWithFields);
}
return schema;
}

6
backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs

@ -49,7 +49,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
{
Name = "id",
Description = "The id of the asset (GUID).",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.NonNullGuid
}
};
@ -88,14 +88,14 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
{
Name = "filter",
Description = "Optional OData filter.",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.String
},
new QueryArgument(AllTypes.None)
{
Name = "orderby",
Description = "Optional OData order definition.",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.String
}
};

18
backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs

@ -69,7 +69,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
{
Name = "id",
Description = "The id of the content (GUID).",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.NonNullGuid
}
};
@ -108,21 +108,21 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
{
Name = "filter",
Description = "Optional OData filter.",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.String
},
new QueryArgument(AllTypes.None)
{
Name = "orderby",
Description = "Optional OData order definition.",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.String
},
new QueryArgument(AllTypes.None)
{
Name = "search",
Description = "Optional OData full text search.",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.String
}
};
@ -186,7 +186,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
{
Name = "id",
Description = "The id of the content (GUID)",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.NonNullGuid
},
new QueryArgument(AllTypes.None)
@ -231,21 +231,21 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
{
Name = "id",
Description = "The id of the content (GUID)",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.NonNullGuid
},
new QueryArgument(AllTypes.None)
{
Name = "status",
Description = "The new status",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.NonNullString
},
new QueryArgument(AllTypes.None)
{
Name = "dueTime",
Description = "When to change the status",
DefaultValue = EtagVersion.Any,
DefaultValue = null,
ResolvedType = AllTypes.Date
},
new QueryArgument(AllTypes.None)
@ -275,7 +275,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
{
Name = "id",
Description = "The id of the content (GUID)",
DefaultValue = string.Empty,
DefaultValue = null,
ResolvedType = AllTypes.NonNullGuid
},
new QueryArgument(AllTypes.None)

2
backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj

@ -24,7 +24,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="GraphQL" Version="3.0.0" />
<PackageReference Include="GraphQL" Version="3.0.0.2026" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.7" />
<PackageReference Include="Microsoft.Orleans.CodeGenerator.MSBuild" Version="3.2.2">
<PrivateAssets>all</PrivateAssets>

2
backend/src/Squidex/Squidex.csproj

@ -35,7 +35,7 @@
<ItemGroup>
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="3.1.3" />
<PackageReference Include="GraphQL.NewtonsoftJson" Version="3.0.0" />
<PackageReference Include="GraphQL.NewtonsoftJson" Version="3.0.0.2026" />
<PackageReference Include="IdentityServer4" Version="4.0.4" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="IdentityServer4.AspNetIdentity" Version="4.0.4" />

4
backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj

@ -19,8 +19,8 @@
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="6.2.1" />
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="GraphQL" Version="3.0.0" />
<PackageReference Include="GraphQL.NewtonsoftJson" Version="3.0.0" />
<PackageReference Include="GraphQL" Version="3.0.0.2026" />
<PackageReference Include="GraphQL.NewtonsoftJson" Version="3.0.0.2026" />
<PackageReference Include="Lorem.Universal.Net" Version="3.0.64" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />

2
frontend/app/shared/components/app-form.component.html

@ -39,7 +39,7 @@
<button type="submit" class="btn btn-success">
{{ 'common.create' | sqxTranslate }}
2</button>
</button>
</ng-container>
</sqx-modal-dialog>
</form>
Loading…
Cancel
Save