New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework GraphQL API surface and migrate to Hot Chocolate from GraphQL.NET #663
Rework GraphQL API surface and migrate to Hot Chocolate from GraphQL.NET #663
Conversation
Moved from #636 |
This pull request introduces 4 alerts when merging c4d7ea4 into 22df00b - view on LGTM.com new alerts:
|
Seems like the latest HC v11 Previews have support for |
Out of the queries,
As for mutations, we'll need to do some research on subscriptions, but for now I want to preserve the pull nature of scraping and installation. |
This pull request introduces 10 alerts when merging 4f0584e into 3074c7a - view on LGTM.com new alerts:
|
This pull request introduces 10 alerts when merging e5f991a into 3074c7a - view on LGTM.com new alerts:
|
This pull request introduces 10 alerts when merging a17a19f into 3074c7a - view on LGTM.com new alerts:
|
This pull request introduces 10 alerts when merging 9a9578a into 3074c7a - view on LGTM.com new alerts:
|
This pull request introduces 10 alerts when merging df5cf13 into 3074c7a - view on LGTM.com new alerts:
|
This pull request introduces 10 alerts when merging 7ee4e97 into 3074c7a - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #663 +/- ##
=======================================
Coverage 71.64% 71.64%
=======================================
Files 484 484
Lines 15007 15007
Branches 848 848
=======================================
Hits 10752 10752
Misses 3916 3916
Partials 339 339 Continue to review full report at Codecov.
|
382ad19
to
0f57d26
Compare
…em.IServiceProvider
Lacks Installable support, to be implemented in another commit
This pull request introduces 21 alerts and fixes 6 when merging 6c68f23 into 3074c7a - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 18 alerts and fixes 6 when merging e583a6c into 3074c7a - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 15 alerts and fixes 6 when merging 3d41c6d into 3074c7a - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 9 alerts and fixes 6 when merging 563aa39 into 3074c7a - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 10 alerts and fixes 6 when merging 8154e4b into 3074c7a - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 10 alerts and fixes 6 when merging ae5ec1a into 3074c7a - view on LGTM.com new alerts:
fixed alerts:
|
onVerbObject subscriptions are global and occur whenever a mutation occurs. onObjectVerb subscriptions are specific to an transient object that is referred to by some GUID.
This pull request introduces 10 alerts and fixes 6 when merging 38ca30b into 3074c7a - view on LGTM.com new alerts:
fixed alerts:
|
Need to remove after merging #663
Common Framework Level Improvements
These are common framework-level improvements that assist in the Hot Chocolate infrastructure, but also benefit elsewhere.
IQueryable
inIGameLibrary
IServiceRepository
instance within theCompose
hook of anIComposable
to aSystem.IServiceProvider
IInstallable
s now must specify the name of the sourceIGameInstaller
that produced it.IControllerElementMappings
toIControllerElementMappingProfile
IControllerElementMappingsStore
is nowIControllerElementMappingProfileStore
IServiceContainer
is now an internal interfaceEmulatorCompatibility
API toIEmulatorOrchestrator
to better define compatibilityIAsyncEnumerable
inIAsyncJobQueue
IAsyncJobQueue
IAsyncEnumerable<T>
TaskResult
sSeedTree
is now collapsed with a stack instead of recursively.GameConfigurationExtensionProvider
now implements method to fetch the collection GUID of an individual Value.GameConfigurationExtension
now implement methods to fetch a configuration collection using the collection GUID rather than a profile nameTodo List
S.F.Remoting
ArgumentException
in S.F.R.G.FrameworkQueries`S.F.R.GraphQL
.Hot Chocolate Wishlist features
Should we consider dropping theQueryBuilder
API in favour of using Hot Chocolate directly?QueryBuilder
is to be deprecated and removed in favour of full access to services in a GraphQL context.S.F.Remoting
, leaving extension points.GraphQLFrameworkQueries
is a plugin, but that means extending these GraphQL models require a reference to the plugin!QueryBuilder
type resolution is done at the function level at the latest possible moment, so third-party GraphQL extensions have no access to these types.GameType
needs an extension point.We'll need some way to extend the providedIServiceRepository
for dependency injection or just give up on injecting internal dependencies for Query types, for example inInstallationQueryBuilder
. We either consider polluting theIServiceRepository
API by making it user extensible local to the instance, or give up entirely on injecting local dependencies, and have the parameterized constructor construct references.Uuid
into the specific object instance required, for example in the configuration APIs. Perhaps we can do this with field middleware?Query
games(GameFilter) : GameConnection
files(FileFilter) : [FileInfo!]
saves(SaveFilter)
record: GameRecord
orchestration
fs
(See Filesystem Remoting API #645)stone
platforms
controllers
devices
mappings
plugins
meta
Why should
Snowflake.Framework.*
be privileged within GraphQL?The old GraphQL implementation started off which the philosophy that nothing should be privileged. Although I've made GraphQL progressively more and more privileged within Snowflake, I wanted to stay protocol-agnostic. While eventually Kestrel and the GraphQL.NET runtime were merged into Services for necessity, the actual GraphlQL interfaces remained separated.
The issue was that while the GraphQL interfaces adopted some of the philosophy, much of it was written to be protocol-agnostic. In many ways, it looked more like a REST API separated into units of work, and that was because it was descended from a REST API. There was no useful sense of hierarchy, that is to say, types and function calls were treated separately.
The issue with this approach is that if anyone were to want to extend existing GraphQL functionality, it would not be possible without referencing the existing types, and thus the GraphQLFrameworkQueries plugin. In essence, GraphQLFrameworkQueries was intended to be glue, but in reality was a core part of the API if GraphQL was to be priviledged.
With HotChocolate, I take a different approach. I blur the lines behind Services and Data, and implement some of the API within Snowflake.Framework.Remoting. Anything that can be returned by a method call should have a GraphQL analogue within Snowflake.Framework.Remoting, such that consumers can simply say "return [a Snowflake object]" in a field definition, without having to reference Plugin assemblies. Then, anything that provides access to such data, such as a library extension or a service call, will be put into GraphQLFrameworkQueries. A thin wrapper across HotChocolate provides complete access to the server for more advanced use cases.