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

Make sure types are always escaped correctly #752

Closed
designatednerd opened this issue Sep 5, 2019 · 0 comments · Fixed by apollographql/apollo-tooling#1515
Closed

Make sure types are always escaped correctly #752

designatednerd opened this issue Sep 5, 2019 · 0 comments · Fixed by apollographql/apollo-tooling#1515
Labels
codegen Issues related to or arising from code generation enhancement Issues outlining new things we want to do or things that will make our lives as devs easier

Comments

@designatednerd
Copy link
Contributor

We've had to make several fixes related to #193 - we should absolutely have a centralized way of escaping types rather than forcing everything to escape them as needed.

@designatednerd designatednerd added codegen Issues related to or arising from code generation enhancement Issues outlining new things we want to do or things that will make our lives as devs easier labels Sep 5, 2019
lilyball added a commit to lilyball/apollo-tooling that referenced this issue Sep 9, 2019
The source generator now operates using a string wrapper type called
`SwiftSource`. Identifiers are escaped when converting into
`SwiftSource` values, with an alternative method for producing escaped
string literals. An escape hatch is provided for disabling escapes, but
the default behavior is to escape all identifiers in the dynamic input.

Most `SwiftSource` values are produced by a tagged template literal,
which allows for easy mixing of string literals containing Swift
keywords and dynamic input that needs escaping.

As part of this, rewrite string escaping such that it actually escapes
string contents properly. This required fixing a test that had a bad
spec enforcing broken behavior.

Fixes apollographql/apollo-ios#193.
Fixes apollographql/apollo-ios#752.
lilyball added a commit to lilyball/apollo-tooling that referenced this issue Sep 9, 2019
The source generator now operates using a string wrapper type called
`SwiftSource`. Identifiers are escaped when converting into
`SwiftSource` values, with an alternative method for producing escaped
string literals. An escape hatch is provided for disabling escapes, but
the default behavior is to escape all identifiers in the dynamic input.

Most `SwiftSource` values are produced by a tagged template literal,
which allows for easy mixing of string literals containing Swift
keywords and dynamic input that needs escaping.

As part of this, rewrite string escaping such that it actually escapes
string contents properly. This required fixing a test that had a bad
spec enforcing broken behavior.

Fixes apollographql/apollo-ios#193.
Fixes apollographql/apollo-ios#752.
lilyball added a commit to lilyball/apollo-tooling that referenced this issue Sep 10, 2019
The source generator now operates using a string wrapper type called
`SwiftSource`. Identifiers are escaped when converting into
`SwiftSource` values, with an alternative method for producing escaped
string literals. An escape hatch is provided for disabling escapes, but
the default behavior is to escape all identifiers in the dynamic input.

Most `SwiftSource` values are produced by a tagged template literal,
which allows for easy mixing of string literals containing Swift
keywords and dynamic input that needs escaping.

As part of this, rewrite string escaping such that it actually escapes
string contents properly. This required fixing a test that had a bad
spec enforcing broken behavior.

Fixes apollographql/apollo-ios#193.
Fixes apollographql/apollo-ios#752.
lilyball added a commit to lilyball/apollo-tooling that referenced this issue Sep 10, 2019
The source generator now operates using a string wrapper type called
`SwiftSource`. Identifiers are escaped when converting into
`SwiftSource` values, with an alternative method for producing escaped
string literals. An escape hatch is provided for disabling escapes, but
the default behavior is to escape all identifiers in the dynamic input.

Most `SwiftSource` values are produced by a tagged template literal,
which allows for easy mixing of string literals containing Swift
keywords and dynamic input that needs escaping.

As part of this, rewrite string escaping such that it actually escapes
string contents properly. This required fixing a test that had a bad
spec enforcing broken behavior.

Fixes apollographql/apollo-ios#193.
Fixes apollographql/apollo-ios#752.
lilyball added a commit to lilyball/apollo-tooling that referenced this issue Sep 10, 2019
The source generator now operates using a string wrapper type called
`SwiftSource`. Identifiers are escaped when converting into
`SwiftSource` values, with an alternative method for producing escaped
string literals. An escape hatch is provided for disabling escapes, but
the default behavior is to escape all identifiers in the dynamic input.

Most `SwiftSource` values are produced by a tagged template literal,
which allows for easy mixing of string literals containing Swift
keywords and dynamic input that needs escaping.

As part of this, rewrite string escaping such that it actually escapes
string contents properly. This required fixing a test that had a bad
spec enforcing broken behavior.

This commit makes the test added earlier pass.

Fixes apollographql/apollo-ios#193.
Fixes apollographql/apollo-ios#752.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen Issues related to or arising from code generation enhancement Issues outlining new things we want to do or things that will make our lives as devs easier
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant