Skip to content

Commit 36bcffe

Browse files
committed
Preserve escaped string literals for defaultValueString
1 parent edd1b95 commit 36bcffe

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

samples/introspection/IntrospectionSchema.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ void AddTypesToSchema(const std::shared_ptr<introspection::Schema>& schema)
672672
R"gql(FIELD_DEFINITION)gql",
673673
R"gql(ENUM_VALUE)gql"
674674
}), std::vector<std::shared_ptr<introspection::InputValue>>({
675-
std::make_shared<introspection::InputValue>("reason", R"md()md", schema->LookupType("String"), R"gql(No longer supported)gql")
675+
std::make_shared<introspection::InputValue>("reason", R"md()md", schema->LookupType("String"), R"gql("No longer supported")gql")
676676
})));
677677
}
678678

src/GraphQLTree.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ struct ast_selector<string_value>
202202
}
203203
}
204204

205-
n->remove_content();
206205
n->children.clear();
207206
}
208207
};

src/SchemaGenerator.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,9 +1296,7 @@ InputFieldList Generator::getInputFields(const std::vector<std::unique_ptr<peg::
12961296

12971297
defaultValue.visit(*child->children.back());
12981298
field.defaultValue = defaultValue.getValue();
1299-
field.defaultValueString = child->children.back()->unescaped.empty()
1300-
? child->children.back()->string_view()
1301-
: child->children.back()->unescaped;
1299+
field.defaultValueString = child->children.back()->string_view();
13021300

13031301
defaultValueLocation = { position.line, position.byte_in_line };
13041302
}

0 commit comments

Comments
 (0)