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

[apollo-execution] Allow to pass arguments to the root types #5352

Merged
merged 6 commits into from
Nov 6, 2023

Conversation

martinbonnin
Copy link
Contributor

Add a ${ServiceName}ExecutableSchemaBuilder() constructor function that sets up a pre-configured ExecutableSchema.Builder.

This function takes a () -> QueryType, etc.. for root types so it's easier to pass arguments to the root instances.

@martinbonnin martinbonnin changed the title Allow to pass arguments to the root types [apollo-execution] Allow to pass arguments to the root types Nov 3, 2023
@@ -23,6 +23,9 @@
<Properties>
<option name="KEEP_BLANK_LINES" value="true" />
</Properties>
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why this started happening. This is for scala so I do not expect too much impact. If this ends up moving too much, I'll dig into it.

Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

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

Very cool! 🎉

Base automatically changed from apollo-debug-server to main November 6, 2023 10:23
Copy link

netlify bot commented Nov 6, 2023

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 68065dc
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/6548d7cb71ef730008d1c842

Copy link
Contributor Author

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

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

Can't approve my own PR but LGTM!

if (apolloClients.containsValue(id)) error("Name '$id' already registered")
apolloClients[apolloClient] = id
startOrStopServer()
lock.withLock {
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 don't think that works? This locks the writer but readers from the HTTP request thread won't use the lock and might iterate the list while it is modified

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah you're right! I liked the AtomicReference idea but didn't like that it's JVM only. But maybe that's ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AtomicFu has KMP versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah great! 🎉
I think I'll use JVM AtomicReference to avoid adding the AtomicFu dependency, but with the knowledge that we can use it to support more targets.

@BoD BoD merged commit ecaa391 into main Nov 6, 2023
9 checks passed
@BoD BoD deleted the root-types-args branch November 6, 2023 13:30
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.

2 participants