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

Add support for specifiedBy directive #1616

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kay-schecker
Copy link

Hi, I just added support for the @specifiedBy directive, because it is still missing and I need the support, because otherwise the validation of https://github.com/spawnia/sailor fails and blocks me.

Can you please take a review?

Todos left
I was not able to fix SchemaExtenderTest.testExtendsScalarsByAddingSpecifiedByDirective during my timeframe :/

Can you support here please?

Thanks a lot,
Kay

@@ -414,7 +414,8 @@ protected function p(?Node $node): string
return BlockString::print($node->value);
}

return \json_encode($node->value, JSON_THROW_ON_ERROR);
// Do not escape unicode or slashes in order to keep urls valid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Do not escape unicode or slashes in order to keep urls valid
// Do not escape unicode or slashes in order to keep URLs valid

Comment on lines 26 to +31
public const IF_ARGUMENT_NAME = 'if';
public const SKIP_NAME = 'skip';
public const DEPRECATED_NAME = 'deprecated';
public const SPECIFIED_BY_NAME = 'specifiedBy';
public const REASON_ARGUMENT_NAME = 'reason';
public const URL_ARGUMENT_NAME = 'url';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public const IF_ARGUMENT_NAME = 'if';
public const SKIP_NAME = 'skip';
public const DEPRECATED_NAME = 'deprecated';
public const SPECIFIED_BY_NAME = 'specifiedBy';
public const REASON_ARGUMENT_NAME = 'reason';
public const URL_ARGUMENT_NAME = 'url';
public const SKIP_NAME = 'skip';
public const IF_ARGUMENT_NAME = 'if';
public const DEPRECATED_NAME = 'deprecated';
public const REASON_ARGUMENT_NAME = 'reason';
public const SPECIFIED_BY_NAME = 'specifiedBy';
public const URL_ARGUMENT_NAME = 'url';

Comment on lines +408 to +409
* Given a collection of directives, returns the string value for the
* specifiedBy url.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Given a collection of directives, returns the string value for the
* specifiedBy url.
* Given a collection of directives, returns the string value for the specifiedBy URL.

@@ -318,7 +318,7 @@ public function testWSLWithWellPlacedDirectives(): void

extend type MyObj @onObject

scalar MyScalar @onScalar
scalar MyScalar @onScalar
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scalar MyScalar @onScalar
scalar MyScalar @onScalar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants