Skip to content

Commit 2976784

Browse files
authored
issue #615 prefetchMethod documentation fix (#616)
* issue #615 prefetchMethod documentation fix * issue #615 prefetchMethod previous versions documentation fix
1 parent 7b41bc9 commit 2976784

File tree

9 files changed

+34
-66
lines changed

9 files changed

+34
-66
lines changed

website/docs/prefetch-method.mdx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,13 @@ Instead, GraphQLite offers an easier to implement solution: the ability to fetch
5555
#[Type]
5656
class PostType {
5757
/**
58-
* @param Post $post
5958
* @param mixed $prefetchedUsers
6059
* @return User
6160
*/
6261
#[Field]
63-
public function getUser(Post $post, #[Prefetch("prefetchUsers")] $prefetchedUsers): User
62+
public function getUser(#[Prefetch("prefetchUsers")] $prefetchedUsers): User
6463
{
65-
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
64+
// This method will receive the $prefetchedUsers as first argument. This is the return value of the "prefetchUsers" method below.
6665
// Using this prefetched list, it should be easy to map it to the post
6766
}
6867

@@ -91,13 +90,12 @@ class PostType {
9190
class PostType {
9291
/**
9392
* @Field(prefetchMethod="prefetchUsers")
94-
* @param Post $post
9593
* @param mixed $prefetchedUsers
9694
* @return User
9795
*/
98-
public function getUser(Post $post, $prefetchedUsers): User
96+
public function getUser($prefetchedUsers): User
9997
{
100-
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
98+
// This method will receive the $prefetchedUsers as first argument. This is the return value of the "prefetchUsers" method below.
10199
// Using this prefetched list, it should be easy to map it to the post
102100
}
103101

@@ -145,12 +143,11 @@ For instance:
145143
#[Type]
146144
class PostType {
147145
/**
148-
* @param Post $post
149146
* @param mixed $prefetchedComments
150147
* @return Comment[]
151148
*/
152149
#[Field]
153-
public function getComments(Post $post, #[Prefetch("prefetchComments")] $prefetchedComments): array
150+
public function getComments(#[Prefetch("prefetchComments")] $prefetchedComments): array
154151
{
155152
// ...
156153
}
@@ -177,11 +174,10 @@ class PostType {
177174
class PostType {
178175
/**
179176
* @Field(prefetchMethod="prefetchComments")
180-
* @param Post $post
181177
* @param mixed $prefetchedComments
182178
* @return Comment[]
183179
*/
184-
public function getComments(Post $post, $prefetchedComments): array
180+
public function getComments($prefetchedComments): array
185181
{
186182
// ...
187183
}

website/versioned_docs/version-3.0/prefetch_method.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ Instead, GraphQLite offers an easier to implement solution: the ability to fetch
5555
#[Type]
5656
class PostType {
5757
/**
58-
* @param Post $post
5958
* @param mixed $prefetchedUsers
6059
* @return User
6160
*/
6261
#[Field(prefetchMethod: "prefetchUsers")]
63-
public function getUser(Post $post, $prefetchedUsers): User
62+
public function getUser($prefetchedUsers): User
6463
{
6564
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
6665
// Using this prefetched list, it should be easy to map it to the post
@@ -91,11 +90,10 @@ class PostType {
9190
class PostType {
9291
/**
9392
* @Field(prefetchMethod="prefetchUsers")
94-
* @param Post $post
9593
* @param mixed $prefetchedUsers
9694
* @return User
9795
*/
98-
public function getUser(Post $post, $prefetchedUsers): User
96+
public function getUser($prefetchedUsers): User
9997
{
10098
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
10199
// Using this prefetched list, it should be easy to map it to the post
@@ -142,12 +140,11 @@ For instance:
142140
#[Type]
143141
class PostType {
144142
/**
145-
* @param Post $post
146143
* @param mixed $prefetchedComments
147144
* @return Comment[]
148145
*/
149146
#[Field(prefetchMethod: "prefetchComments")]
150-
public function getComments(Post $post, $prefetchedComments): array
147+
public function getComments($prefetchedComments): array
151148
{
152149
// ...
153150
}
@@ -174,11 +171,10 @@ class PostType {
174171
class PostType {
175172
/**
176173
* @Field(prefetchMethod="prefetchComments")
177-
* @param Post $post
178174
* @param mixed $prefetchedComments
179175
* @return Comment[]
180176
*/
181-
public function getComments(Post $post, $prefetchedComments): array
177+
public function getComments($prefetchedComments): array
182178
{
183179
// ...
184180
}

website/versioned_docs/version-4.0/prefetch_method.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ Instead, GraphQLite offers an easier to implement solution: the ability to fetch
4848
class PostType {
4949
/**
5050
* @Field(prefetchMethod="prefetchUsers")
51-
* @param Post $post
5251
* @param mixed $prefetchedUsers
5352
* @return User
5453
*/
55-
public function getUser(Post $post, $prefetchedUsers): User
54+
public function getUser($prefetchedUsers): User
5655
{
5756
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
5857
// Using this prefetched list, it should be easy to map it to the post
@@ -90,11 +89,10 @@ For instance:
9089
class PostType {
9190
/**
9291
* @Field(prefetchMethod="prefetchComments")
93-
* @param Post $post
9492
* @param mixed $prefetchedComments
9593
* @return Comment[]
9694
*/
97-
public function getComments(Post $post, $prefetchedComments): array
95+
public function getComments($prefetchedComments): array
9896
{
9997
// ...
10098
}

website/versioned_docs/version-4.1/prefetch_method.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,11 @@ Instead, GraphQLite offers an easier to implement solution: the ability to fetch
5656
#[Type]
5757
class PostType {
5858
/**
59-
* @param Post $post
6059
* @param mixed $prefetchedUsers
6160
* @return User
6261
*/
6362
#[Field(prefetchMethod: "prefetchUsers")]
64-
public function getUser(Post $post, $prefetchedUsers): User
63+
public function getUser($prefetchedUsers): User
6564
{
6665
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
6766
// Using this prefetched list, it should be easy to map it to the post
@@ -92,11 +91,10 @@ class PostType {
9291
class PostType {
9392
/**
9493
* @Field(prefetchMethod="prefetchUsers")
95-
* @param Post $post
9694
* @param mixed $prefetchedUsers
9795
* @return User
9896
*/
99-
public function getUser(Post $post, $prefetchedUsers): User
97+
public function getUser($prefetchedUsers): User
10098
{
10199
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
102100
// Using this prefetched list, it should be easy to map it to the post
@@ -143,12 +141,11 @@ For instance:
143141
#[Type]
144142
class PostType {
145143
/**
146-
* @param Post $post
147144
* @param mixed $prefetchedComments
148145
* @return Comment[]
149146
*/
150147
#[Field(prefetchMethod: "prefetchComments")]
151-
public function getComments(Post $post, $prefetchedComments): array
148+
public function getComments($prefetchedComments): array
152149
{
153150
// ...
154151
}
@@ -175,11 +172,10 @@ class PostType {
175172
class PostType {
176173
/**
177174
* @Field(prefetchMethod="prefetchComments")
178-
* @param Post $post
179175
* @param mixed $prefetchedComments
180176
* @return Comment[]
181177
*/
182-
public function getComments(Post $post, $prefetchedComments): array
178+
public function getComments($prefetchedComments): array
183179
{
184180
// ...
185181
}

website/versioned_docs/version-4.2/prefetch-method.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ Instead, GraphQLite offers an easier to implement solution: the ability to fetch
5555
#[Type]
5656
class PostType {
5757
/**
58-
* @param Post $post
5958
* @param mixed $prefetchedUsers
6059
* @return User
6160
*/
6261
#[Field(prefetchMethod: "prefetchUsers")]
63-
public function getUser(Post $post, $prefetchedUsers): User
62+
public function getUser($prefetchedUsers): User
6463
{
6564
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
6665
// Using this prefetched list, it should be easy to map it to the post
@@ -91,11 +90,10 @@ class PostType {
9190
class PostType {
9291
/**
9392
* @Field(prefetchMethod="prefetchUsers")
94-
* @param Post $post
9593
* @param mixed $prefetchedUsers
9694
* @return User
9795
*/
98-
public function getUser(Post $post, $prefetchedUsers): User
96+
public function getUser($prefetchedUsers): User
9997
{
10098
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
10199
// Using this prefetched list, it should be easy to map it to the post
@@ -142,12 +140,11 @@ For instance:
142140
#[Type]
143141
class PostType {
144142
/**
145-
* @param Post $post
146143
* @param mixed $prefetchedComments
147144
* @return Comment[]
148145
*/
149146
#[Field(prefetchMethod: "prefetchComments")]
150-
public function getComments(Post $post, $prefetchedComments): array
147+
public function getComments($prefetchedComments): array
151148
{
152149
// ...
153150
}
@@ -174,11 +171,10 @@ class PostType {
174171
class PostType {
175172
/**
176173
* @Field(prefetchMethod="prefetchComments")
177-
* @param Post $post
178174
* @param mixed $prefetchedComments
179175
* @return Comment[]
180176
*/
181-
public function getComments(Post $post, $prefetchedComments): array
177+
public function getComments($prefetchedComments): array
182178
{
183179
// ...
184180
}

website/versioned_docs/version-4.3/prefetch-method.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ Instead, GraphQLite offers an easier to implement solution: the ability to fetch
5555
#[Type]
5656
class PostType {
5757
/**
58-
* @param Post $post
5958
* @param mixed $prefetchedUsers
6059
* @return User
6160
*/
6261
#[Field(prefetchMethod: "prefetchUsers")]
63-
public function getUser(Post $post, $prefetchedUsers): User
62+
public function getUser($prefetchedUsers): User
6463
{
6564
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
6665
// Using this prefetched list, it should be easy to map it to the post
@@ -91,11 +90,10 @@ class PostType {
9190
class PostType {
9291
/**
9392
* @Field(prefetchMethod="prefetchUsers")
94-
* @param Post $post
9593
* @param mixed $prefetchedUsers
9694
* @return User
9795
*/
98-
public function getUser(Post $post, $prefetchedUsers): User
96+
public function getUser($prefetchedUsers): User
9997
{
10098
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
10199
// Using this prefetched list, it should be easy to map it to the post
@@ -142,12 +140,11 @@ For instance:
142140
#[Type]
143141
class PostType {
144142
/**
145-
* @param Post $post
146143
* @param mixed $prefetchedComments
147144
* @return Comment[]
148145
*/
149146
#[Field(prefetchMethod: "prefetchComments")]
150-
public function getComments(Post $post, $prefetchedComments): array
147+
public function getComments($prefetchedComments): array
151148
{
152149
// ...
153150
}
@@ -174,11 +171,10 @@ class PostType {
174171
class PostType {
175172
/**
176173
* @Field(prefetchMethod="prefetchComments")
177-
* @param Post $post
178174
* @param mixed $prefetchedComments
179175
* @return Comment[]
180176
*/
181-
public function getComments(Post $post, $prefetchedComments): array
177+
public function getComments($prefetchedComments): array
182178
{
183179
// ...
184180
}

website/versioned_docs/version-5.0/prefetch-method.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ Instead, GraphQLite offers an easier to implement solution: the ability to fetch
5555
#[Type]
5656
class PostType {
5757
/**
58-
* @param Post $post
5958
* @param mixed $prefetchedUsers
6059
* @return User
6160
*/
6261
#[Field(prefetchMethod: "prefetchUsers")]
63-
public function getUser(Post $post, $prefetchedUsers): User
62+
public function getUser($prefetchedUsers): User
6463
{
6564
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
6665
// Using this prefetched list, it should be easy to map it to the post
@@ -91,11 +90,10 @@ class PostType {
9190
class PostType {
9291
/**
9392
* @Field(prefetchMethod="prefetchUsers")
94-
* @param Post $post
9593
* @param mixed $prefetchedUsers
9694
* @return User
9795
*/
98-
public function getUser(Post $post, $prefetchedUsers): User
96+
public function getUser($prefetchedUsers): User
9997
{
10098
// This method will receive the $prefetchedUsers as second argument. This is the return value of the "prefetchUsers" method below.
10199
// Using this prefetched list, it should be easy to map it to the post
@@ -142,12 +140,11 @@ For instance:
142140
#[Type]
143141
class PostType {
144142
/**
145-
* @param Post $post
146143
* @param mixed $prefetchedComments
147144
* @return Comment[]
148145
*/
149146
#[Field(prefetchMethod: "prefetchComments")]
150-
public function getComments(Post $post, $prefetchedComments): array
147+
public function getComments($prefetchedComments): array
151148
{
152149
// ...
153150
}
@@ -174,11 +171,10 @@ class PostType {
174171
class PostType {
175172
/**
176173
* @Field(prefetchMethod="prefetchComments")
177-
* @param Post $post
178174
* @param mixed $prefetchedComments
179175
* @return Comment[]
180176
*/
181-
public function getComments(Post $post, $prefetchedComments): array
177+
public function getComments($prefetchedComments): array
182178
{
183179
// ...
184180
}

0 commit comments

Comments
 (0)