Lighthouse: Description displays incorrectly

Created on 6 Sep 2018  ·  6Comments  ·  Source: nuwave/lighthouse

For some reasons, the description looks like this😂
(I'm using the dev-master ver.)

image

bug

Most helpful comment

Just a quick update: I realized the bug was on our side after all. Working on the fix at the moment.

I noticed that we do not pass descriptions for arguments, so i am reworking that as well. Stay tuned!

All 6 comments

Same problem !! 👍

This has to do with the new description syntax.

Apparently, webonyx/graphql-php only implemented one half of it correctly - the parsing. Schema printing and introspection are buggy. While slightly ugly, this is not unusable, so i tend to just wait for a fix, which will possibly come in their 0.13

@spawnia Actually, this is unusable for Japanese description. Multi-byte characters, like Japanese (Probably Chinese, Korean as well ), are not even parsed correctly.

enum productStatus {
  """
  登録済み
  """
  REGISTERED @enum(value: 0)

  """
  レンタル可能
  """
  AVAILABLE @enum(value: 1)

  """
  レンタル中
  """
  RENTED @enum(value: 2)

  """
  クリーニング中
  """
  CLEANING @enum(value: 3)
}

These descriptions looks like this in GraphQL-Playground.
screen shot on 2018-09-18 at 20_02_18

@nob that surely is unfortunate. If you can come up with a fix, i am willing to accept a PR. If not, i will stick to waiting for the upstream library to fix this.

@spawnia I start using Lighthouse few days ago and have used Folkloreatelier/laravel-graphql before.
I'm not sure I can figure it out... but wondering why laravel-graphql is able to print those descriptions correctly in GraphQL-Playground(in Japanese), even though it use webonyx/graphql-php inside it's package as well.

/**
 * laravel-graphql Mutation class
 */
class addCreditCard extends Mutation
{
    protected $attributes = [
        'name' => 'addCreditCard',
        'description' => 'ユーザのクレジットカード情報を追加' //laravel-graphql's way to define a description.
    ];

....

screen shot on 2018-09-18 at 23_13_47

Is that because laravel-graphql doesn't directly parse schema.graphql file?

Just a quick update: I realized the bug was on our side after all. Working on the fix at the moment.

I noticed that we do not pass descriptions for arguments, so i am reworking that as well. Stay tuned!

Was this page helpful?
0 / 5 - 0 ratings