-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 graphql type generation after package upgrades #27738
Conversation
…to an object and not just the value
💔 Build Failed |
@@ -77,7 +76,7 @@ export const formatUncommonProcessesData = ( | |||
fields.reduce( | |||
(flattenedFields, fieldName) => { | |||
flattenedFields.uncommonProcess._id = hit._id; | |||
flattenedFields.uncommonProcess.instances = hit.total; | |||
flattenedFields.uncommonProcess.instances = getOr(0, 'total.value', hit); |
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.
This is an interesting change. It is now hit.total.value
rather than hit.total
and it can be undefined
as well?
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.
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.
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.
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
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.
Good API upgrade change.
total: 1, | ||
total: { | ||
value: 1, | ||
relation: 'eq', |
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.
This is an interesting API output change.
💚 Build Succeeded |
Summary
This fixes the SIEM UI graphql type generation after relevant packages have been upgraded in #25157.
Notes
public/graphql/types.ts
andserver/graphql/types.ts
instead 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.json
file has similarly been moved to thepublic/graphql
directory.Context
type injection introduced by the upstream code generation package.