GraphQLSwift / Graphiti

The Swift GraphQL Schema framework for macOS and Linux
MIT License
532 stars 67 forks source link

Fix: Wrapped Aliased Type Resolution #90

Closed NeedleInAJayStack closed 1 year ago

NeedleInAJayStack commented 1 year ago

This fixes https://github.com/GraphQLSwift/Graphiti/issues/41

This added a collection of all SwiftTypes and their aliased GraphQL names to TypeProvider. These names are collected before any GraphQL types are created, and are used when resolving TypeReferences, so out-of-order references to aliased types are no longer mis-addressed.

To do so, we had to add a setGraphQLName function to the Component class, and implementations for all GraphQL Type components (Enum, Input, Interface, Scalar, Schema, Type, and Union). Schema construction now goes through all components to collect names prior to building up the GraphQL schema objects.

NeedleInAJayStack commented 1 year ago

Hey @paulofaria, you mind giving this one a quick review?

paulofaria commented 1 year ago

Got this error message when trying to merge.

image

NeedleInAJayStack commented 1 year ago

@paulofaria Woah, weird. It let me merge it fine...