Skip to content
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

Port Printer from graphql-js #130

Merged
merged 2 commits into from
Nov 6, 2023
Merged

Conversation

samisuteria
Copy link
Contributor

Ported printer functions from https://github.com/graphql/graphql-js/blob/main/src/language/printer.ts with the goal of using it with federation features. Currently users need to use .setFederatedSDL(to: <String>) in the schema builder in Graphiti and this feels like a step toward removing that requirement.

Still need to port printString and printBlockString functions from the js implementation but that ran into some complications and I would prefer to do that in a future PR.

I'm still unsure about how to expose this in Graphiti and get the document type to GraphQLSchema.

ast.printed
}

private protocol Printable {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created this protocol instead of using CustomStringConvertible because some of the nodes already have a variable called description and it was clashing.

Copy link
Member

@NeedleInAJayStack NeedleInAJayStack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks excellent! Great work!

@NeedleInAJayStack NeedleInAJayStack merged commit 3f01aa5 into GraphQLSwift:main Nov 6, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants