Fix graphql type generation after package upgrades#27738
Merged
XavierM merged 3 commits intoelastic:feature-secopsfrom Dec 23, 2018
Merged
Fix graphql type generation after package upgrades#27738XavierM merged 3 commits intoelastic:feature-secopsfrom
XavierM merged 3 commits intoelastic:feature-secopsfrom
Conversation
…to an object and not just the value
Contributor
💔 Build Failed |
| (flattenedFields, fieldName) => { | ||
| flattenedFields.uncommonProcess._id = hit._id; | ||
| flattenedFields.uncommonProcess.instances = hit.total; | ||
| flattenedFields.uncommonProcess.instances = getOr(0, 'total.value', hit); |
Contributor
There was a problem hiding this comment.
This is an interesting change. It is now hit.total.value rather than hit.total and it can be undefined as well?
Contributor
There was a problem hiding this comment.
If so, that's fine, wondering if we can just directly use hit.total.value or if we have to use the getOr. I am fine with it if we have to use the getOr though.
Contributor
Author
There was a problem hiding this comment.
Yes that was just an easy fix, I also want to investigate the relation attribute to make sure that we do the right thing here and for other query in the future
FrankHassanabad
approved these changes
Dec 23, 2018
Contributor
FrankHassanabad
left a comment
There was a problem hiding this comment.
Good API upgrade change.
| total: 1, | ||
| total: { | ||
| value: 1, | ||
| relation: 'eq', |
Contributor
There was a problem hiding this comment.
This is an interesting API output change.
Contributor
💚 Build Succeeded |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This fixes the SIEM UI graphql type generation after relevant packages have been upgraded in #25157.
Notes
public/graphql/types.tsandserver/graphql/types.tsinstead of a shared file incommon/graphql. Client-side code should therefore exclusively use the client-side types while server-side code should only import the server-side types.introspection.jsonfile has similarly been moved to thepublic/graphqldirectory.Contexttype injection introduced by the upstream code generation package.