-
Notifications
You must be signed in to change notification settings - Fork 657
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
[Codegen] Add CompiledArgumentDefinition #5797
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d6841b8
Add CompiledArgumentDefinition
BoD 4f91c7d
Re-introduce CompiledArgument.name and CompiledArgument.isKey as depr…
BoD cf477f6
Have field definitions and their arguments generated inside type classes
BoD 9b695ab
Add field parent types to usedFields
BoD 0c31cca
Generate top level fields in the type classes: val field__arg = Compi…
BoD c5cf8cc
Introduce UsedCoordinates to replace usage of Maps and track argument…
BoD 7f991af
Regenerate .expected
BoD 86b27cf
Update CacheArgumentTest
BoD d6257c2
fixup! Introduce UsedCoordinates to replace usage of Maps and track a…
BoD 1446aa5
If a type is in alwaysGenerateTypesMatching, include all the args of …
BoD e102483
Add used types to expected files
BoD 9078bf6
Don't store GQL information directly in IrArgument/IrArgumentDefiniti…
BoD 6070b5e
Regenerate .expected
BoD 1ebd0d7
Remove superfluous KDoc
BoD 30662ff
Indent the used-coordinates.json.expected files
BoD 3ececf6
Fix comment of CompiledArgument.value
BoD 25c04da
Track argument usage inside merge
BoD b0d2dae
Regenerate .expected
BoD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,10 +129,17 @@ internal class IrCompositeType2(val name: String) : IrType2 | |
|
||
@Serializable | ||
internal data class IrArgumentDefinition( | ||
val id: String, | ||
val name: String, | ||
val propertyName: String, | ||
val isKey: Boolean, | ||
val isPagination: Boolean, | ||
) | ||
) { | ||
companion object { | ||
fun id(type: String, field: String, argument: String) = "$type.$field.$argument" | ||
fun propertyName(fieldName: String, argumentName: String) = "__${fieldName}_${argumentName}" | ||
Comment on lines
+133
to
+134
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For later: we should come up with some rules about symbols. Are |
||
} | ||
} | ||
|
||
@Serializable | ||
internal data class IrMapProperty( | ||
|
@@ -322,6 +329,8 @@ private fun GQLFieldDefinition.toIrFieldDefinition( | |
null | ||
} else { | ||
IrArgumentDefinition( | ||
id = IrArgumentDefinition.id(parentType, name, it.name), | ||
propertyName = IrArgumentDefinition.propertyName(name, it.name), | ||
name = it.name, | ||
isKey = keyArgs.contains(it.name), | ||
isPagination = paginationArgs.contains(it.name) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For later: we can use the coordinate to lookup the matching kotlin instead of adding a new kind each time.