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

[GraphQL] Ensures that all types are registered #2875

Merged
merged 3 commits into from
Apr 18, 2019

Conversation

jamesdphillips
Copy link
Contributor

@jamesdphillips jamesdphillips commented Apr 10, 2019

What is this change?

Ensures that all types are registered.

Why is this change necessary?

Types that are not directly referenced by the root Schema type or any of
their children are not immediately registered with the schema. As such to
ensure that ALL types are available we append any that are missing.

For example, consider the following:

interface Err {
  message: String!
}

type InputErr implements Err {
  message: String!
  code: Int!
  input: String
}

type StdErr implement Err {
  message: String!
}

type MutationRoot {
  shutdown(node: String!) {
    err: Err
  }
}

# When the schema object is initialized, it walks the graph resolving each dependency and
# registering each type in it's lookup table. However, in the case below, the StdErr and InputErr
# objects are never directly referenced by either the Schema root or MutationRoot objects. This 
# means that at runtime the schema is unable to resolve either of the Err types.
# 
# As a result we must take the additional step (see commit 5f09c0e) of registering types
# missing in the schema's lookup table.
schema {
  mutation: MutationRoot
}

Does your change need a Changelog entry?

I would say no.

I am marking this as a regression as I tried to fix but only exacerbated the issue in #2847.

Do you need clarification on anything?

No.

Were there any complications while making this change?

When updating the integration test, I found another small issue with the union type.

Have you reviewed and updated the documentation for this change? Is new documentation required?

None required.

How did you verify this change?

An integration test and manual testing.

Types that are not directly referenced by the root Schema type or any of
their children are not immediately registered with the schema. As such to
ensure that ALL types are available we append any that are missing.

Signed-off-by: James Phillips <[email protected]>
Signed-off-by: James Phillips <[email protected]>
@jamesdphillips jamesdphillips added component:web-ui Sensu dashboard improvements regression labels Apr 10, 2019
@jamesdphillips jamesdphillips marked this pull request as ready for review April 10, 2019 22:36
Signed-off-by: James Phillips <[email protected]>
@jamesdphillips jamesdphillips changed the title Disconnected fix [GraphQL] Ensures that all types are registered Apr 10, 2019
Copy link
Contributor

@palourde palourde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jamesdphillips jamesdphillips changed the base branch from master to release-5.6.0 April 15, 2019 19:50
@jamesdphillips jamesdphillips merged commit 3c0ff8e into release-5.6.0 Apr 18, 2019
@jamesdphillips jamesdphillips deleted the disconnected-fix branch April 18, 2019 16:37
echlebek added a commit that referenced this pull request Apr 25, 2019
* Create 5.6.0 release branch

Signed-off-by: Eric Chlebek <[email protected]>

* Bugfix for annotations & labels flags (#2881)

Signed-off-by: Simon Plourde <[email protected]>

* Move dashboard source code into its own repository (#2869)

As our project has grown, build targets increased, and time has passed, the ideal of a monorepo housing both the web and backend has simply caused more friction than it has reduced. Today we are moving Sensu Go Web into it's own repository: sensu/web.

Signed-off-by: James Phillips <[email protected]>

* [GraphQL] Ensures that all types are registered (#2875)

Types that are not directly referenced by the root Schema type or any of
their children are not immediately registered with the schema. As such to
ensure that ALL types are available we append any that are missing.

Signed-off-by: James Phillips <[email protected]>

* Add message bus to tessend (#2886)

Signed-off-by: Nikki Attea <[email protected]>

* Feature/cluster id hex (#2893)

Signed-off-by: Nikki Attea <[email protected]>

* Add support for field selectors (#2892)

Signed-off-by: Simon Plourde <[email protected]>

* Proxy api from dashboard daemon (#2885)

Signed-off-by: James Phillips <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:web-ui Sensu dashboard improvements regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants