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

fieldPath field #120

Closed
wants to merge 23 commits into from
Closed

fieldPath field #120

wants to merge 23 commits into from

Conversation

avalanche123
Copy link
Collaborator

@avalanche123 avalanche123 commented Jul 14, 2023

This PR buids on #119, as such the diff currently includes both.
To see only new additions, use avalanche123/xgql@no-json-if-not-requested...field-path

  • extend gqlgen's goType directive
  • add fieldPath and deprecate unstructured

Description of your changes

Add a new field fieldPath that deprecates unstructured and allows to be
exact in which data needs to be selected:

{
  name: fieldPath(path: "metadata.name")
  images: fieldPath(path: "spec.containers[*].image")
}

Some modification of gqlgen's code generation process was necessary to remove
the no longer used Unstructured field and enforce delegation for the "unstructured"
and "fieldPath" fields to the embedded model.PavedAccess field of generated
structs.

I have:

  • Read and followed Upbound's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

I've tested it both locally via playground and on a running MCP via console.

Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
@avalanche123 avalanche123 requested review from negz and a team July 14, 2023 15:05
@avalanche123
Copy link
Collaborator Author

opened #121 instead

@avalanche123 avalanche123 deleted the field-path branch July 14, 2023 23: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.

1 participant