michannne / graphql-core Goto Github PK
View Code? Open in Web Editor NEWA wrapper library for GraphQL.NET that provides additional features to ease enterprise integration
License: MIT License
A wrapper library for GraphQL.NET that provides additional features to ease enterprise integration
License: MIT License
GenericType works for Model A, containing following member types:
But additional value types, such as char, decimal, byte etc, throw runtime error
Edit: Enum types also throw an error
Expected result
All C# value types are supported
Creating a model such as the following:
public class Book_WithValueTypes : Book
{
public Guid Identifier { get; set; }
public char Category { get; set; }
public decimal Dewey { get; set; }
public byte OwnerCount { get; set; }
public sbyte Modifier { get; set; }
public short Value { get; set; }
public uint Copies { get; set; }
public ulong Pages { get; set; }
public ushort AuthorCount { get; set; }
public BookDescription Info { get; set; }
}
fails to create Object node as Guid is not supported
Full test coverage should be available for following features:
Each test must check for:
Self-explanatory
Model A has a Model A ID
Model B has a Model A ID and a Model B ID
Model C has a Model B ID and a Model C ID
Stitching via Model A => Model B => Model C throws an Access Denied
User has been confused about app not working
No documentation showing in GraphiQL and Intellisense not working in GraphiQL
Problem was that user did not have a GraphQLController to handle requests
Expected Outcome
User should know to add GraphQLController to add references
Readme should reference the need to add a GraphQLController to their project
(Maybe this can be simplified?)
Users should be able to reference a centralized github.io page to read more documentation, see more examples of usage and installation, and tips for usage of the framework.
(config)
argument of .AddGraphQL()
should be optional
If user passes in a configuration, AddGraphQL()
should return a null object and build the config passed in
Otherwise, it should return a new builder which can be extended
Is your feature request related to a problem? Please describe.
Current query arg syntax is unwiedly, and involves the use of an extension method to convert a C# type into a graph type. Yes, it should be up to the user to supply the correct graph-type, but there should be an easier way so user does not have to think too much of the type or conversions before passing it in.
Describe the solution you'd like
Something simple, and easy for the user without giving up their control of the type being passed, but without conversion, such as:
services.AddGraphQL()
.Query<Author>(
() => new Query()
{
Expression = "author",
Args = new ArgList() {
["authorId"] = (long authorId) => {
DefaultValue = 0,
Description = "The Author to be searched"
},
["bookId"] = (long bookId) => {
DefaultValue = 0,
Description = "The Book to be searched"
},
["bookName"] = (string bookName) => {
DefaultValue = null,
Description = "The name of the Book to be searched"
},
},
Resolver = (context) => authorRepo.GetAll().Where(a => a.AuthorId == (long)context.Arguments["authorId"])
})
.Build()
Describe alternatives you've considered
Improving the conversion syntax may also be helpful, but the real solution I feel is change how the arguments are added, in GraphQL.NET is equally painful
Class A references Class B
Class B references Class A
This situation throws a 'Duplicate type class' from app
Expected Outcome
If Class A is already registered, it should not be throwing a duplicate type error. Instead, it should use GenericType in the field prop and pass without looping again over A's properties
Stitched fields, which are present on models under a different name, throw error 'Access Violation'
Expected Result
Stitched field should add properly without issue and be resolvable as long as it does not have the same name as any existing field
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.