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

[fix] experimental compiler: allow default args on required fields #3612

Closed

Conversation

tbezman
Copy link
Contributor

@tbezman tbezman commented Oct 9, 2021

At Coinbase, we were trying out the experimental compiler and this was the first issue we ran into.

The JS compiler allowed this and it seems valid. Let me know if this is out of spec.

CC @kassens @captbaritone

@facebook-github-bot
Copy link
Contributor

Hi @tbezman!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

4 similar comments
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot
Copy link
Contributor

@captbaritone has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@captbaritone
Copy link
Contributor

Awesome! Glad to see that you've managed to get the compiler building well enough to start hitting issues. This matches with my read of the spec here: https://spec.graphql.org/June2018/#sec-Required-Arguments

I've imported this PR into our system to get it merged.

Great to see you already contributing, thanks!

@captbaritone
Copy link
Contributor

It looks like there are some superficial test fixtures changes that need to be updated. Adding a new field to the test schema slightly changes the serialized value in some test output. Fixing this should be as simple as running:

cd oss/crates/graphql-ir
UPDATE_SNAPSHOTS=1 cargo test

@tbezman
Copy link
Contributor Author

tbezman commented Oct 11, 2021

@captbaritone Oh nice, I manually created that snapshot file haha. Let me know if things are looking better in the latest commit.

@facebook-github-bot
Copy link
Contributor

@captbaritone has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@tbezman
Copy link
Contributor Author

tbezman commented Oct 11, 2021

Also, @captbaritone are y'all planning on publishing the latest version of the experimental compiler soon or should we just be building from source until it becomes more stable?

@captbaritone
Copy link
Contributor

captbaritone commented Oct 11, 2021

It looks like there is currently some internal dependence on this behavior, despite the fact that required arguments with defaults does seem to be valid as per the spec. I think the ideal solution would be to make this change (so that our IR conforms to the spec) and move this check into a separate validation pass that's Facebook only, or is at least configurable. I'm going to talk to some folks internally to better understand what's at play, and get back to you.

As for our release, I don't think we're planning on publishing new releases of the compiler until we do an official release later this month half. That said, if it would make a big difference to you, let me know and I can see if it would be feasible.

@tbezman
Copy link
Contributor Author

tbezman commented Oct 12, 2021

@captbaritone That seems like a reasonable solution to me. And regarding the release, if y'all are rolling out later this month then it shouldn't be an issue. I don't think we have a lot of Rust tooling at Coinbase and would not want to be the first to set it up haha

@captbaritone
Copy link
Contributor

Oops. Typo earlier. I said "this month" when I meant to write "this half".

@tbezman
Copy link
Contributor Author

tbezman commented Oct 19, 2021

@captbaritone Still seems like a reasonable timeline for us. Looking forward to it.

@captbaritone
Copy link
Contributor

captbaritone commented Oct 19, 2021 via email

@alunyov alunyov mentioned this pull request Nov 8, 2021
13 tasks
@tbezman
Copy link
Contributor Author

tbezman commented Dec 13, 2021

@captbaritone Any updates on this front? I know you guys have a list of things to do but I'm curious of timeline stuff here. Coinbase is trying to do this upgrade in Q1 2022

@captbaritone
Copy link
Contributor

Hey! Thanks for pinging, and sorry for the delay. We'll be meeting internally tomorrow to continue this discussion and hopefully have a good answer then. Either way, I'll provide an updater here tomorrow afternoon.

@facebook-github-bot
Copy link
Contributor

@captbaritone has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@captbaritone
Copy link
Contributor

Merged. Thanks @tbezman!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants