Create GraphQL project (#1334)

* Create new project for GraphQL

* ...

* .

* ok?

* Update src/WireMock.Net.Shared/Extensions/AnyOfExtensions.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* --

* ...

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Stef Heyenrath
2025-08-10 19:00:22 +02:00
committed by GitHub
parent 0d510cdde8
commit 0597a73e0e
38 changed files with 266 additions and 230 deletions

View File

@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using AnyOfTypes;
using Newtonsoft.Json;
using WireMock.Models.GraphQL;
namespace WireMock.Models;
@@ -22,17 +23,16 @@ public class GraphQLSchemaDetails
/// </summary>
public StringPattern? SchemaAsStringPattern { get; set; }
#if GRAPHQL
/// <summary>
/// The GraphQL schema as a <seealso cref="GraphQL.Types.ISchema"/>.
/// The GraphQL schema as a <seealso cref="ISchemaData"/>.
/// </summary>
public GraphQL.Types.ISchema? SchemaAsISchema { get; set; }
public ISchemaData? SchemaAsISchemaData { get; set; }
/// <summary>
/// The GraphQL Schema.
/// </summary>
[JsonIgnore]
public AnyOf<string, StringPattern, GraphQL.Types.ISchema>? Schema
public AnyOf<string, StringPattern, ISchemaData>? Schema
{
get
{
@@ -46,15 +46,14 @@ public class GraphQLSchemaDetails
return SchemaAsStringPattern;
}
if (SchemaAsISchema != null)
if (SchemaAsISchemaData != null)
{
return new AnyOf<string, StringPattern, GraphQL.Types.ISchema>(SchemaAsISchema);
return new AnyOf<string, StringPattern, ISchemaData>(SchemaAsISchemaData);
}
return null;
}
}
#endif
/// <summary>
/// The custom Scalars to define for this schema.