Skip to content

Commit

Permalink
Fix nullable scalars inside array.
Browse files Browse the repository at this point in the history
  • Loading branch information
byme8 committed Jul 16, 2023
1 parent ba8ac1b commit 458904d
Show file tree
Hide file tree
Showing 13 changed files with 146 additions and 124 deletions.
40 changes: 25 additions & 15 deletions src/TestApp/TestStandardLibrary/Generated/GraphQL.g.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// b212168374f26038cc7200986070affe
// d2b780c89b6d8a786ffdeaaa61bafb2a
// This file generated for ZeroQL.
// <auto-generated/>
#pragma warning disable 8618
Expand Down Expand Up @@ -52,7 +52,7 @@ public class Circle : IFigure, IEntity

[JsonPropertyName("creator")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public Person __Creator { get; set; }
public Person? __Creator { get; set; }

[ZeroQL.GraphQLName("creator")]
public T? Creator<T>(Func<Person, T> selector = default !)
Expand All @@ -63,7 +63,7 @@ public class Circle : IFigure, IEntity
// This member is not indented to be used. https://github.com/byme8/ZeroQL/issues/58
[JsonIgnore]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
IPerson IFigure.__Creator { get; set; }
IPerson? IFigure.__Creator { get; set; }

[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
T? IFigure.Creator<T>(Func<IPerson, T> selector = default !)
Expand Down Expand Up @@ -225,6 +225,16 @@ public class Mutation : global::ZeroQL.Internal.IMutation
return __DateTime;
}

[JsonPropertyName("dateTimes")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public DateTimeOffset? []? __DateTimes { get; set; }

[ZeroQL.GraphQLName("dateTimes")]
public DateTimeOffset?[]? DateTimes([ZeroQL.GraphQLType("[DateTime]")] DateTimeOffset[]? dateTime = default !)
{
return __DateTimes;
}

[JsonPropertyName("dateTimeOffset")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public DateTimeOffset __DateTimeOffset { get; set; }
Expand Down Expand Up @@ -341,7 +351,7 @@ public class Mutation : global::ZeroQL.Internal.IMutation

[JsonPropertyName("addLimitNullable")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public LimitZeroQL __AddLimitNullable { get; set; }
public LimitZeroQL? __AddLimitNullable { get; set; }

[ZeroQL.GraphQLName("addLimitNullable")]
public T? AddLimitNullable<T>([ZeroQL.GraphQLType("LimitInput")] LimitInputZeroQL? limit = default !, Func<LimitZeroQL, T> selector = default !)
Expand All @@ -361,7 +371,7 @@ public class Mutation : global::ZeroQL.Internal.IMutation

[JsonPropertyName("addLimit2Nullable")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public Limit2ZeroQL __AddLimit2Nullable { get; set; }
public Limit2ZeroQL? __AddLimit2Nullable { get; set; }

[ZeroQL.GraphQLName("addLimit2Nullable")]
public T? AddLimit2Nullable<T>([ZeroQL.GraphQLType("Limit2Input")] Limit2Input? limit = default !, Func<Limit2ZeroQL, T> selector = default !)
Expand All @@ -371,7 +381,7 @@ public class Mutation : global::ZeroQL.Internal.IMutation

[JsonPropertyName("addLimit3")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public Limit3 __AddLimit3 { get; set; }
public Limit3? __AddLimit3 { get; set; }

[ZeroQL.GraphQLName("addLimit3")]
public T? AddLimit3<T>([ZeroQL.GraphQLType("Limit3Input")] Limit3InputZeroQL? limit = default !, Func<Limit3, T> selector = default !)
Expand Down Expand Up @@ -480,7 +490,7 @@ public class Point : IFigure, IEntity
// This member is not indented to be used. https://github.com/byme8/ZeroQL/issues/58
[JsonIgnore]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
IPerson IFigure.__Creator { get; set; }
IPerson? IFigure.__Creator { get; set; }

[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
T? IFigure.Creator<T>(Func<IPerson, T> selector = default !)
Expand Down Expand Up @@ -677,7 +687,7 @@ public class Query : global::ZeroQL.Internal.IQuery

[JsonPropertyName("user")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public User __User { get; set; }
public User? __User { get; set; }

[ZeroQL.GraphQLName("user")]
public T? User<T>([ZeroQL.GraphQLType("Int!")] int id = default !, Func<User, T> selector = default !)
Expand Down Expand Up @@ -707,7 +717,7 @@ public class Query : global::ZeroQL.Internal.IQuery

[JsonPropertyName("admin")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public User __Admin { get; set; }
public User? __Admin { get; set; }

[ZeroQL.GraphQLName("admin")]
public T? Admin<T>([ZeroQL.GraphQLType("Int!")] int id = default !, Func<User, T> selector = default !)
Expand Down Expand Up @@ -807,7 +817,7 @@ public class Square : IFigure, IEntity

[JsonPropertyName("creator")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public IPerson __Creator { get; set; }
public IPerson? __Creator { get; set; }

[ZeroQL.GraphQLName("creator")]
public T? Creator<T>(Func<IPerson, T> selector = default !)
Expand Down Expand Up @@ -963,7 +973,7 @@ public class TypesContainer

[JsonPropertyName("value28")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public KeyValuePairOfStringAndString[] __Value28 { get; set; }
public KeyValuePairOfStringAndString[]? __Value28 { get; set; }

[ZeroQL.GraphQLName("value28")]
public T[]? Value28<T>(Func<KeyValuePairOfStringAndString, T> selector = default !)
Expand All @@ -983,7 +993,7 @@ public class TypesContainer

[JsonPropertyName("value30")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public KeyValuePairOfStringAndString __Value30 { get; set; }
public KeyValuePairOfStringAndString? __Value30 { get; set; }

[ZeroQL.GraphQLName("value30")]
public T? Value30<T>(Func<KeyValuePairOfStringAndString, T> selector = default !)
Expand Down Expand Up @@ -1022,7 +1032,7 @@ public class User

[JsonPropertyName("role")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public Role __Role { get; set; }
public Role? __Role { get; set; }

[ZeroQL.GraphQLName("role")]
public T? Role<T>(Func<Role, T> selector = default !)
Expand Down Expand Up @@ -1060,7 +1070,7 @@ public interface IFigure : global::ZeroQL.IUnionType

[JsonPropertyName("creator")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public IPerson __Creator { get; set; }
public IPerson? __Creator { get; set; }

[ZeroQL.GraphQLName("creator")]
public T? Creator<T>(Func<IPerson, T> selector = default !);
Expand All @@ -1079,7 +1089,7 @@ public class IFigureStub : IFigure

[JsonPropertyName("creator")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public IPerson __Creator { get; set; }
public IPerson? __Creator { get; set; }

[ZeroQL.GraphQLName("creator")]
public T? Creator<T>(Func<IPerson, T> selector = default !)
Expand Down
40 changes: 25 additions & 15 deletions src/TestApp/ZeroQL.TestApp/Generated/GraphQL.g.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ecce768958de6d75a0825a7322c84587
// 13f414ba7b9b7b647d5105e3b9697837
// This file generated for ZeroQL.
// <auto-generated/>
#pragma warning disable 8618
Expand Down Expand Up @@ -52,7 +52,7 @@ public class Circle : IFigure, IEntity

[JsonPropertyName("creator")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public Person __Creator { get; set; }
public Person? __Creator { get; set; }

[ZeroQL.GraphQLName("creator")]
public T? Creator<T>(Func<Person, T> selector = default !)
Expand All @@ -63,7 +63,7 @@ public class Circle : IFigure, IEntity
// This member is not indented to be used. https://github.com/byme8/ZeroQL/issues/58
[JsonIgnore]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
IPerson IFigure.__Creator { get; set; }
IPerson? IFigure.__Creator { get; set; }

[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
T? IFigure.Creator<T>(Func<IPerson, T> selector = default !)
Expand Down Expand Up @@ -225,6 +225,16 @@ public class Mutation : global::ZeroQL.Internal.IMutation
return __DateTime;
}

[JsonPropertyName("dateTimes")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public DateTimeOffset? []? __DateTimes { get; set; }

[ZeroQL.GraphQLName("dateTimes")]
public DateTimeOffset?[]? DateTimes([ZeroQL.GraphQLType("[DateTime]")] DateTimeOffset[]? dateTime = default !)
{
return __DateTimes;
}

[JsonPropertyName("dateTimeOffset")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public DateTimeOffset __DateTimeOffset { get; set; }
Expand Down Expand Up @@ -341,7 +351,7 @@ public class Mutation : global::ZeroQL.Internal.IMutation

[JsonPropertyName("addLimitNullable")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public LimitZeroQL __AddLimitNullable { get; set; }
public LimitZeroQL? __AddLimitNullable { get; set; }

[ZeroQL.GraphQLName("addLimitNullable")]
public T? AddLimitNullable<T>([ZeroQL.GraphQLType("LimitInput")] LimitInputZeroQL? limit = default !, Func<LimitZeroQL, T> selector = default !)
Expand All @@ -361,7 +371,7 @@ public class Mutation : global::ZeroQL.Internal.IMutation

[JsonPropertyName("addLimit2Nullable")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public Limit2ZeroQL __AddLimit2Nullable { get; set; }
public Limit2ZeroQL? __AddLimit2Nullable { get; set; }

[ZeroQL.GraphQLName("addLimit2Nullable")]
public T? AddLimit2Nullable<T>([ZeroQL.GraphQLType("Limit2Input")] Limit2Input? limit = default !, Func<Limit2ZeroQL, T> selector = default !)
Expand All @@ -371,7 +381,7 @@ public class Mutation : global::ZeroQL.Internal.IMutation

[JsonPropertyName("addLimit3")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public Limit3 __AddLimit3 { get; set; }
public Limit3? __AddLimit3 { get; set; }

[ZeroQL.GraphQLName("addLimit3")]
public T? AddLimit3<T>([ZeroQL.GraphQLType("Limit3Input")] Limit3InputZeroQL? limit = default !, Func<Limit3, T> selector = default !)
Expand Down Expand Up @@ -480,7 +490,7 @@ public class Point : IFigure, IEntity
// This member is not indented to be used. https://github.com/byme8/ZeroQL/issues/58
[JsonIgnore]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
IPerson IFigure.__Creator { get; set; }
IPerson? IFigure.__Creator { get; set; }

[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
T? IFigure.Creator<T>(Func<IPerson, T> selector = default !)
Expand Down Expand Up @@ -677,7 +687,7 @@ public class Query : global::ZeroQL.Internal.IQuery

[JsonPropertyName("user")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public User __User { get; set; }
public User? __User { get; set; }

[ZeroQL.GraphQLName("user")]
public T? User<T>([ZeroQL.GraphQLType("Int!")] int id = default !, Func<User, T> selector = default !)
Expand Down Expand Up @@ -707,7 +717,7 @@ public class Query : global::ZeroQL.Internal.IQuery

[JsonPropertyName("admin")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public User __Admin { get; set; }
public User? __Admin { get; set; }

[ZeroQL.GraphQLName("admin")]
public T? Admin<T>([ZeroQL.GraphQLType("Int!")] int id = default !, Func<User, T> selector = default !)
Expand Down Expand Up @@ -807,7 +817,7 @@ public class Square : IFigure, IEntity

[JsonPropertyName("creator")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public IPerson __Creator { get; set; }
public IPerson? __Creator { get; set; }

[ZeroQL.GraphQLName("creator")]
public T? Creator<T>(Func<IPerson, T> selector = default !)
Expand Down Expand Up @@ -963,7 +973,7 @@ public class TypesContainer

[JsonPropertyName("value28")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public KeyValuePairOfStringAndString[] __Value28 { get; set; }
public KeyValuePairOfStringAndString[]? __Value28 { get; set; }

[ZeroQL.GraphQLName("value28")]
public T[]? Value28<T>(Func<KeyValuePairOfStringAndString, T> selector = default !)
Expand All @@ -983,7 +993,7 @@ public class TypesContainer

[JsonPropertyName("value30")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public KeyValuePairOfStringAndString __Value30 { get; set; }
public KeyValuePairOfStringAndString? __Value30 { get; set; }

[ZeroQL.GraphQLName("value30")]
public T? Value30<T>(Func<KeyValuePairOfStringAndString, T> selector = default !)
Expand Down Expand Up @@ -1022,7 +1032,7 @@ public class User

[JsonPropertyName("role")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public Role __Role { get; set; }
public Role? __Role { get; set; }

[ZeroQL.GraphQLName("role")]
public T? Role<T>(Func<Role, T> selector = default !)
Expand Down Expand Up @@ -1060,7 +1070,7 @@ public interface IFigure : global::ZeroQL.IUnionType

[JsonPropertyName("creator")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public IPerson __Creator { get; set; }
public IPerson? __Creator { get; set; }

[ZeroQL.GraphQLName("creator")]
public T? Creator<T>(Func<IPerson, T> selector = default !);
Expand All @@ -1079,7 +1089,7 @@ public class IFigureStub : IFigure

[JsonPropertyName("creator")]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public IPerson __Creator { get; set; }
public IPerson? __Creator { get; set; }

[ZeroQL.GraphQLName("creator")]
public T? Creator<T>(Func<IPerson, T> selector = default !)
Expand Down
1 change: 1 addition & 0 deletions src/TestApp/ZeroQL.TestApp/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type Limit3 {
type Mutation {
createInstant(instant: Instant!): Instant!
dateTime(dateTime: DateTime!): DateTime!
dateTimes(dateTime: [DateTime]): [DateTime]
dateTimeOffset(dateTimeOffset: DateTime!): DateTime!
timeSpan(timeSpan: TimeSpan!): TimeSpan!
dateOnly(dateOnly: Date!): Date!
Expand Down
2 changes: 2 additions & 0 deletions src/ZeroQL.TestServer/Query/DateMutation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ public class DateMutation
{
public DateTime GetDateTime(DateTime dateTime) => dateTime;

public DateTime?[]? GetDateTimes(DateTime?[]? dateTime) => dateTime;

public DateTimeOffset GetDateTimeOffset(DateTimeOffset dateTimeOffset) => dateTimeOffset;

public TimeSpan GetTimeSpan(TimeSpan timeSpan) => timeSpan;
Expand Down
Loading

0 comments on commit 458904d

Please sign in to comment.