这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@sobrinho
Copy link
Contributor

@sobrinho sobrinho commented Mar 28, 2020

Description

Hasura was rendering strings and objects as the same in browse rows, we couldn't differentiate one from another.

Changelog

  • CHANGELOG.md is updated with user-facing content relevant to this PR.

Affected components

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System
  • Tests
  • Other (list it)

Related Issues

#4201

Solution and Design

Checking if the column is a JSON or JSONB type instead of only if the value is an object fix the issue.

Before (You couldn't tell that one of the rows is a string by mistake):

Screen Shot 2020-03-28 at 18 41 24

After (You can see the difference clearly):

Screen Shot 2020-03-28 at 18 37 46

Steps to test and verify

Create one json and one jsonb columns, create two rows, one with both values as {"object":true} and another one with both values as "{\"string\": \"true\"}".

You can't tell the difference in Browse Rows before and you should after this fix.

Limitations, known bugs & workarounds

None.

Server checklist

None.

Catalog upgrade

Does this PR change Hasura Catalog version?

  • No
  • Yes
    • Updated docs with SQL for downgrading the catalog

Metadata

Does this PR add a new Metadata feature?

  • No
  • Yes
    • Does run_sql auto manages the new metadata through schema diffing?
      • Yes
      • Not required
    • Does run_sql auto manages the definitions of metadata on renaming?
      • Yes
      • Not required
    • Does export_metadata/replace_metadata supports the new metadata added?
      • Yes
      • Not required

GraphQL

  • No new GraphQL schema is generated
  • New GraphQL schema is being generated:
    • New types and typenames are correlated

Breaking changes

  • No Breaking changes

  • There are breaking changes:

    1. Metadata API

      Existing query types:

      • Modify args payload which is not backward compatible
      • Behavioural change of the API
      • Change in response JSON schema
      • Change in error code
    2. GraphQL API

      Schema Generation:

      • Change in any NamedType
      • Change in table field names

      Schema Resolve:-

      • Change in treatment of null value for any input fields
    3. Logging

      • Log JSON schema has changed
      • Log type names have changed

@sobrinho sobrinho requested a review from beerose as a code owner March 28, 2020 21:43
@hasura-bot
Copy link
Contributor

Beep boop! 🤖

Hey @sobrinho, thanks for your PR!

One of my human friends will review this PR and get back to you as soon as possible.

Stay awesome! 😎

@hasura-bot
Copy link
Contributor

Review app for commit 24c2f8b deployed to Heroku: https://hge-ci-pull-4221.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4221-24c2f8bb

Copy link
Contributor

@marionschleifer marionschleifer left a comment

Choose a reason for hiding this comment

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

Changelog approved.

@hasura-bot
Copy link
Contributor

Review app for commit 25aa913 deployed to Heroku: https://hge-ci-pull-4221.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4221-25aa9133

Copy link
Contributor

@beerose beerose left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @sobrinho!

Approving code changes.

@tirumaraiselvan tirumaraiselvan changed the title Fix JSON(B) rendering in data close #4201 Fix JSON(B) rendering in data browser (close #4201) Mar 29, 2020
@beerose beerose requested a review from rikinsk March 30, 2020 09:37
@rikinsk rikinsk requested a review from a team as a code owner March 30, 2020 14:36
@rikinsk
Copy link
Member

rikinsk commented Mar 30, 2020

/heroku deploy

@hasura-bot
Copy link
Contributor

Review app for commit f7b149a deployed to Heroku: https://hge-ci-pull-4221.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4221-f7b149a1

@rikinsk rikinsk merged commit 6056dfa into hasura:master Mar 30, 2020
@hasura-bot
Copy link
Contributor

Beep boop! 🤖

GIF

Awesome work @sobrinho! All of us at Hasura ❤️ what you did.

Thanks again 🤗

@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-4221.herokuapp.com is deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants