-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Not every string can be represented as block string but currently printSchema uses block strings for all descriptions.
Example:
const { buildSchema, parse, printSchema } = require('./dist');
const schema = buildSchema('" " scalar Foo');
const printedSDL = printSchema(schema);
console.log(printedSDL);
// """ """
// scalar Foo
console.log(printSchema(buildSchema(printedSDL)));
// """"""
// scalar FooWe should add a new utility function (in blockString.js) that checks if the string can be represented as a block string and use it inside printSchema.js.
Based on our previous experience with block strings it would be hard to cover all edge cases so I strongly suggest writing fuzzing test for this new function, similar to this one:
| it('correctly print random strings', () => { |
wendorf