Skip to content

Commit 49e2065

Browse files
authored
docs: rename annotations-reference to attributes-reference (#800)
* docs: rename annotations-reference to attributes-reference Doctrine annotation support was dropped in #677; the page's body has been calling these "attributes" for a long time. Bring the filename and URL slug in line so the whole stack uses consistent terminology. What changed - website/docs/annotations-reference.md → attributes-reference.md (plus frontmatter `id` and sidebars.json entry) - versioned_docs/version-8.0.0/ gets the same rename since 8.0.0 is the current stable release served at `/docs/annotations-reference`. Older versioned_docs are frozen snapshots and are left untouched. - versioned_sidebars/version-8.0.0-sidebars.json updated to match. - Incoming link in authentication-authorization.mdx updated (both the `next` and v8.0.0 copies). - CHANGELOG.md and migrating.md link paths updated (both copies). Anchor fragments were already stale (sections were renamed from `## @input annotation` → `## #[Input]` long ago); repointed them at the current slugs where the anchor identifies the attribute unambiguously, and stripped the dead `-annotation` suffix. Backwards compatibility - Added `@docusaurus/plugin-client-redirects` (pinned to the existing 2.4.3 line) with a single rule: `/docs/annotations-reference` → `/docs/attributes-reference`. External inbound links keep working (meta-refresh + JS redirect, preserves the URL fragment). Remaining prose cleanup While touching this area, also fixed a few stale "annotation" prose references that the Doctrine removal missed: - custom-types.mdx: "in the following annotations:" → "attributes:" - semver.md: "through its annotations"/"custom annotations" → attributes - argument-resolving.md: stale `@Autowire annotation` and related wording in the parameter-middleware example Verified via `yarn build`: site compiles clean, redirect HTML emitted at build/docs/annotations-reference/index.html pointing at the new canonical URL. * docs: revert v8.0.0 edits and cut v8.2.0 snapshot instead Follow-up to review feedback: v8.0.0 is a frozen release snapshot and shouldn't be edited to reflect unreleased terminology. Restore all v8.0.0 versioned_docs files to their state at release time (matches origin/master exactly). Instead, cut a new v8.2.0 docs snapshot via `yarn docusaurus docs:version 8.2.0`. That captures the current `docs/` state — including the rename, the prose cleanup, and unreleased features like #[EnumValue] (#793) — as a new versioned release. 8.2.0 becomes the new "latest" (first in versions.json), so `/docs/*` now serves from it and the redirect target `/docs/attributes-reference` is valid. Result: - /docs/annotations-reference → redirects to /docs/attributes-reference - /docs/attributes-reference → v8.2.0 (new latest) - /docs/8.0.0/annotations-reference → v8.0.0 snapshot, frozen, unchanged - /docs/next/attributes-reference → docs/ preview Minor docs-version snapshots are established convention in this project (6.1, 4.3, 4.2, 4.1 are all on record), so cutting 8.2.0 alongside this rename does not break norms. Build verified: `yarn build` passes; redirect HTML emitted at build/docs/annotations-reference/index.html; v8.0.0 snapshot diffs to origin/master as zero.
1 parent 2d643f8 commit 49e2065

53 files changed

Lines changed: 5796 additions & 14 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

website/docs/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ public function toGraphQLInputType(Type $type, ?InputType $subType, string $argu
181181

182182
### New features
183183

184-
- [@Input](annotations-reference.md#input-annotation) annotation is introduced as an alternative to `#[Factory]`. Now GraphQL input type can be created in the same manner as `#[Type]` in combination with `#[Field]` - [example](input-types.mdx#input-attribute).
185-
- New attributes has been added to [@Field](annotations-reference.md#field-annotation) annotation: `for`, `inputType` and `description`.
184+
- [@Input](attributes-reference.md#input) annotation is introduced as an alternative to `#[Factory]`. Now GraphQL input type can be created in the same manner as `#[Type]` in combination with `#[Field]` - [example](input-types.mdx#input-attribute).
185+
- New attributes has been added to [@Field](attributes-reference.md#field) annotation: `for`, `inputType` and `description`.
186186
- The following annotations now can be applied to class properties directly: `#[Field]`, `#[Logged]`, `#[Right]`, `@FailWith`, `@HideIfUnauthorized` and `#[Security]`.
187187

188188
## 4.1.0

website/docs/argument-resolving.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ If you plan to use attributes while resolving arguments, your attribute class sh
6060

6161
For instance, if we want GraphQLite to inject a service in an argument, we can use `#[Autowire]`.
6262

63-
We only need to put declare the annotation can target parameters: `#[Attribute(Attribute::TARGET_PARAMETER)]`.
63+
We only need to declare that the attribute can target parameters: `#[Attribute(Attribute::TARGET_PARAMETER)]`.
6464

6565
The class looks like this:
6666

@@ -106,16 +106,16 @@ class ContainerParameterHandler implements ParameterMiddlewareInterface
106106

107107
public function mapParameter(ReflectionParameter $parameter, DocBlock $docBlock, ?Type $paramTagType, ParameterAnnotations $parameterAnnotations, ParameterHandlerInterface $next): ParameterInterface
108108
{
109-
// The $parameterAnnotations object can be used to fetch any annotation implementing ParameterAnnotationInterface
109+
// The $parameterAnnotations object can be used to fetch any attribute implementing ParameterAnnotationInterface
110110
$autowire = $parameterAnnotations->getAnnotationByType(Autowire::class);
111111

112112
if ($autowire === null) {
113-
// If there are no annotation, this middleware cannot handle the parameter. Let's ask
113+
// If there is no matching attribute, this middleware cannot handle the parameter. Let's ask
114114
// the next middleware in the chain (using the $next object)
115115
return $next->mapParameter($parameter, $docBlock, $paramTagType, $parameterAnnotations);
116116
}
117117

118-
// We found a @Autowire annotation, let's return a parameter resolver.
118+
// We found a #[Autowire] attribute, let's return a parameter resolver.
119119
return new ContainerParameter($this->container, $parameter->getType());
120120
}
121121
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
id: annotations-reference
2+
id: attributes-reference
33
title: Attributes reference
44
sidebar_label: Attributes reference
55
---

website/docs/authentication-authorization.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ By default, a user analysing the GraphQL schema can see all queries/mutations/su
130130
Some will be available to him and some won't.
131131

132132
If you want to add an extra level of security (or if you want your schema to be kept secret to unauthorized users),
133-
you can use the `#[HideIfUnauthorized]` attribute. Beware of [it's limitations](annotations-reference.md).
133+
you can use the `#[HideIfUnauthorized]` attribute. Beware of [it's limitations](attributes-reference.md).
134134

135135
```php
136136
class UserController

website/docs/custom-types.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ You can help GraphQLite by manually specifying the output type to use:
4141

4242
The `outputType` attribute will map the return value of the method to the output type passed in parameter.
4343

44-
You can use the `outputType` attribute in the following annotations:
44+
You can use the `outputType` attribute in the following attributes:
4545

4646
* `#[Query]`
4747
* `#[Mutation]`

website/docs/migrating.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ If you are a "regular" GraphQLite user, migration to v4 should be straightforwar
3232
- In GraphQLite v3, the default was to hide a field from the schema if a user has no access to it.
3333
In GraphQLite v4, the default is to still show this field, but to throw an error if the user makes a query on it
3434
(this way, the schema is the same for all users). If you want the old mode, use the new
35-
[`@HideIfUnauthorized` annotation](annotations-reference.md#hideifunauthorized-annotation)
35+
[`@HideIfUnauthorized` annotation](attributes-reference.md#hideifunauthorized)
3636
- If you are using the Symfony bundle, the Laravel package or the Universal module, you must also upgrade those to 4.0.
3737
These package will take care of the wiring for you. Apart for upgrading the packages, you have nothing to do.
3838
- If you are relying on the `SchemaFactory` to bootstrap GraphQLite, you have nothing to do.

website/docs/semver.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ To avoid being bound to our backward compatibility promise, such features can be
1616

1717
As a rule of thumb:
1818

19-
- If you are a GraphQLite user (using GraphQLite mainly through its annotations), we guarantee strict semantic versioning
20-
- If you are extending GraphQLite features (if you are developing custom annotations, or if you are developing a GraphQlite integration
19+
- If you are a GraphQLite user (using GraphQLite mainly through its attributes), we guarantee strict semantic versioning
20+
- If you are extending GraphQLite features (if you are developing custom attributes, or if you are developing a GraphQlite integration
2121
with a framework...), be sure to check the tags.
2222

2323
Said otherwise:

website/docusaurus.config.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,19 @@ module.exports={
5050
}
5151
]
5252
],
53-
"plugins": [],
53+
"plugins": [
54+
[
55+
"@docusaurus/plugin-client-redirects",
56+
{
57+
"redirects": [
58+
{
59+
"from": "/docs/annotations-reference",
60+
"to": "/docs/attributes-reference"
61+
}
62+
]
63+
}
64+
]
65+
],
5466
"themeConfig": {
5567
"navbar": {
5668
"title": "GraphQLite",

website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"devDependencies": {},
1010
"dependencies": {
1111
"@docusaurus/core": "2.4.3",
12+
"@docusaurus/plugin-client-redirects": "2.4.3",
1213
"@docusaurus/preset-classic": "2.4.3",
1314
"clsx": "^1.1.1",
1415
"mdx-mermaid": "^1.2.3",

website/sidebars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
],
5252
"Reference": [
5353
"doctrine-annotations-attributes",
54-
"annotations-reference",
54+
"attributes-reference",
5555
"semver",
5656
"changelog"
5757
]

0 commit comments

Comments
 (0)