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

[GraphQL October 2021] Support @specifiedBy(url: "...") directive (#1000) #1003

Merged
merged 10 commits into from
Dec 20, 2021

Conversation

ilslv
Copy link
Member

@ilslv ilslv commented Dec 9, 2021

Part of #1000

Synopsis

RFC

Solution

Add specified_by_url attribute to Scalar impl and derive macros.

Checklist

  • Created PR:
    • In draft mode
    • Name contains Draft: prefix
    • Name contains issue reference
    • Has assignee
  • Documentation is updated (if required)
  • Tests are updated (if required)
  • Changes conform code style
  • CHANGELOG entry is added (if required)
  • FCM (final commit message) is posted
    • and approved
  • Review is completed and changes are approved
  • Before merge:
    • Milestone is set
    • PR's name and description are correct and up-to-date
    • Draft: prefix is removed
    • All temporary labels are removed

@ilslv ilslv added the enhancement Improvement of existing features or bugfix label Dec 9, 2021
@ilslv ilslv self-assigned this Dec 9, 2021
@ilslv ilslv mentioned this pull request Dec 9, 2021
6 tasks
@ilslv
Copy link
Member Author

ilslv commented Dec 9, 2021

FCM

Support `@specifiedBy(url: "...")` directive via `specified_by_url` attribute argument in `#[graphql_scalar]` and `#[derive(GraphQLScalarValue)]` macros (#1003, #1000)

- support `isRepeatable` field on directives
- support `__Schema.description`, `__Type.specifiedByURL` and `__Directive.isRepeatable` fields in introspection

@ilslv ilslv changed the title Draft: [GraphQL October 2021] Support @specifiedBy(url: "...") directive Draft: [GraphQL October 2021] Support @specifiedBy(url: "...") directive (#1000) Dec 14, 2021
# Conflicts:
#	juniper/src/schema/meta.rs
@ilslv ilslv changed the title Draft: [GraphQL October 2021] Support @specifiedBy(url: "...") directive (#1000) [GraphQL October 2021] Support @specifiedBy(url: "...") directive (#1000) Dec 16, 2021
@ilslv ilslv marked this pull request as ready for review December 16, 2021 10:51
@ilslv ilslv requested a review from tyranron December 16, 2021 11:27
Copy link
Member

@tyranron tyranron left a comment

Choose a reason for hiding this comment

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

@ilslv overall is good, but let's do some additional adjustments:

  1. Check during proc macro expansion whether the given literal is valid URL via Url::parse().
  2. Add codegen failure tests to cover the case where invalid URL is specified.

UPD: I also cannot grasp where the specifiedByUrl directive is inserted into __Schema. It's missed in the introspection query results, while the spec requires it being present. I do see where new_skip and new_include are used though.

@ilslv ilslv requested a review from tyranron December 20, 2021 06:55
@tyranron tyranron added the k::api Related to API (application interface) label Dec 20, 2021
Copy link
Member

@tyranron tyranron left a comment

Choose a reason for hiding this comment

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

@ilslv there is also @deprecated directive is missing in __Schema when intospected. Please, fix in a separate PR.

@tyranron tyranron merged commit 847d09f into master Dec 20, 2021
@tyranron tyranron deleted the specified-by branch December 20, 2021 11:36
@tyranron tyranron added this to the 0.16.0 milestone Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix k::api Related to API (application interface)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants