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

sdl-encoder: encode string values with single quotes (") #930

Merged
merged 2 commits into from
Nov 18, 2021

Conversation

lrlna
Copy link
Member

@lrlna lrlna commented Nov 18, 2021

We've been encoding all BlockStringValues and StringValues by surrounding them with """. StringValue is meant to be encoded with just a single ". If a description does not include a line break or a ", we assume it's a StringValue.

This means that instead of printing this:

"""Shopping list for cats at the pet store"""
type PetStoreTrip implements ShoppingTrip {
  toys: [DanglerPoleToys] @deprecated(reason: "Cats are too spoiled")
  """Dry or wet food?"""
  food: FoodType
  catGrass: Boolean
}

we encode this:

"Shopping list for cats at the pet store"
type PetStoreTrip implements ShoppingTrip {
  toys: [DanglerPoleToys] @deprecated(reason: "Cats are too spoiled")
  "Dry or wet food?"
  food: FoodType
  catGrass: Boolean
}

We've been encoding all BlockStringValues and StringValues by surrounding them with `"""`. StringValue is meant to be encoded with just a single `"`. If a description does not include a line break or a `"`, we assume it's a StringValue.

This means that instead of printing this:
```graphql
"""Shopping list for cats at the pet store"""
type PetStoreTrip implements ShoppingTrip {
  toys: [DanglerPoleToys] @deprecated(reason: "Cats are too spoiled")
  """Dry or wet food?"""
  food: FoodType
  catGrass: Boolean
}
```

we encode this:
```graphql
"Shopping list for cats at the pet store"
type PetStoreTrip implements ShoppingTrip {
  toys: [DanglerPoleToys] @deprecated(reason: "Cats are too spoiled")
  "Dry or wet food?"
  food: FoodType
  catGrass: Boolean
}
```
@EverlastingBugstopper EverlastingBugstopper added this to the v0.4.1 milestone Nov 18, 2021
@EverlastingBugstopper EverlastingBugstopper merged commit d87c5e7 into main Nov 18, 2021
@EverlastingBugstopper EverlastingBugstopper deleted the string_value_encoding branch November 18, 2021 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants