Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ public string Key
{
get
{
field ??= TypeStructure.ToString(indented: false);
if (field is null)
{
var structure = TypeStructure.ToString(indented: false);
field = Context == TypeContext.None ? structure : $"{structure}_{Context}";
}

return field;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,24 @@ public static string ListNullableElementArgumentRef(List<string?> items)

public static string NullableListNullableElementArgumentRef(List<string?>? items)
=> throw new Exception();

// Covers a regression where the same POCO used in both an output position
// (resolver return) and an input position (mutation argument) emitted two
// distinct GraphQL types but the FactoryTypeReference cache keyed only on
// the syntactic structure, so one position reused the IType of the other.
public static IReadOnlyCollection<Shape> GetShapes() => [];
}

public class Shape
{
public required string Key { get; set; }
public required string Name { get; set; }
}

[MutationType]
public static partial class Mutation
{
public static bool SaveShapes(IReadOnlyList<Shape> shapes) => true;
}

public class IsSelectedNode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
schema {
query: Query
mutation: Mutation
subscription: Subscription
}

Expand Down Expand Up @@ -92,9 +93,14 @@ type Query {
listArgumentRef(items: [String!]!): String!
listNullableElementArgumentRef(items: [String]!): String!
nullableListNullableElementArgumentRef(items: [String]): String!
shapes: [Shape!]!
issue8057Entity(id: ID!): Issue8057Entity @cost(weight: "10")
}

type Mutation {
saveShapes(shapes: [ShapeInput!]!): Boolean!
}

type Subscription {
onProductAdded(categoryId: Int!): Int! @cost(weight: "10")
onProductPriceChanged(productId: Int!): Int! @cost(weight: "10")
Expand Down Expand Up @@ -201,6 +207,11 @@ type ProductsEdge {
node: Product!
}

type Shape {
key: String!
name: String!
}

type Television implements Product {
argumentWithExplicitType(arg: Version!): String!
nullableArgumentWithExplicitType(arg: Version): String!
Expand All @@ -218,6 +229,11 @@ interface Product {
id: String!
}

input ShapeInput {
key: String!
name: String!
}

scalar Version

scalar Version2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
schema {
query: Query
mutation: Mutation
subscription: Subscription
}

Expand Down Expand Up @@ -67,9 +68,14 @@ type Query {
listArgumentRef(items: [String!]!): String!
listNullableElementArgumentRef(items: [String]!): String!
nullableListNullableElementArgumentRef(items: [String]): String!
shapes: [Shape!]!
issue8057Entity(id: ID!): Issue8057Entity
}

type Mutation {
saveShapes(shapes: [ShapeInput!]!): Boolean!
}

type Subscription {
onProductAdded(categoryId: Int!): Int!
onProductPriceChanged(productId: Int!): Int!
Expand Down Expand Up @@ -158,6 +164,11 @@ type ProductEdge {
node: Product!
}

type Shape {
key: String!
name: String!
}

type Television implements Product {
argumentWithExplicitType(arg: Version!): String!
nullableArgumentWithExplicitType(arg: Version): String!
Expand All @@ -175,6 +186,11 @@ interface Product {
id: String!
}

input ShapeInput {
key: String!
name: String!
}

scalar Version

scalar Version2
Loading