Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Mar 4, 2024
1 parent c2b99ce commit 6b31712
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
11 changes: 1 addition & 10 deletions generated/.tailcallrc.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,7 @@ directive @cache(
) on FIELD_DEFINITION

"""
For instance, if you have a `user(id: Int!): User @http(path: "/users/{{args.id}}")`
field on the `Query` type, you can reference it from another field on the `Query`
type using the `@call` operator. So, on `Post.user` you can declare `user: User @call(query:
"user", args: {id: "{{value.userId}}"})`, and this will replace the `{{args.id}}`
used in the `@http` operator with the value of `userId` from the `Post` type.In case
you have a `user(input: UserInput!): User @http(path: "/users")` field on the `Mutation`
type, you can reference it from another field on the `Mutation` type. So, on `Post.user`
you can declare `user: User @call(mutation: "user", args: {input: "{{value.userInput}}"})`,
and this will replace the `{{args.input}}` used in the `@http` operator with the
value of `userInput` from the `Post` type.
Provides the ability to refer to a field defined in the root Query or Mutation.
"""
directive @call(
"""
Expand Down
2 changes: 1 addition & 1 deletion generated/.tailcallrc.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
}
},
"Call": {
"description": "For instance, if you have a `user(id: Int!): User @http(path: \"/users/{{args.id}}\")` field on the `Query` type, you can reference it from another field on the `Query` type using the `@call` operator. So, on `Post.user` you can declare `user: User @call(query: \"user\", args: {id: \"{{value.userId}}\"})`, and this will replace the `{{args.id}}` used in the `@http` operator with the value of `userId` from the `Post` type.\n\nIn case you have a `user(input: UserInput!): User @http(path: \"/users\")` field on the `Mutation` type, you can reference it from another field on the `Mutation` type. So, on `Post.user` you can declare `user: User @call(mutation: \"user\", args: {input: \"{{value.userInput}}\"})`, and this will replace the `{{args.input}}` used in the `@http` operator with the value of `userInput` from the `Post` type.",
"description": "Provides the ability to refer to a field defined in the root Query or Mutation.",
"type": "object",
"properties": {
"args": {
Expand Down
8 changes: 2 additions & 6 deletions src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,10 @@ pub struct Http {
pub query: KeyValues,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, Eq, schemars::JsonSchema)]
// The @call operator is used to reference a resolver operator (`@http`, `@grpc`, `@graphQL`) from a field on `Query` type.
///
/// For instance, if you have a `user(id: Int!): User @http(path: "/users/{{args.id}}")` field on the `Query` type, you can reference it from another field on the `Query` type using the `@call` operator.
/// So, on `Post.user` you can declare `user: User @call(query: "user", args: {id: "{{value.userId}}"})`, and this will replace the `{{args.id}}` used in the `@http` operator with the value of `userId` from the `Post` type.
/// Provides the ability to refer to a field defined in the root Query or Mutation.
///
/// In case you have a `user(input: UserInput!): User @http(path: "/users")` field on the `Mutation` type, you can reference it from another field on the `Mutation` type.
/// So, on `Post.user` you can declare `user: User @call(mutation: "user", args: {input: "{{value.userInput}}"})`, and this will replace the `{{args.input}}` used in the `@http` operator with the value of `userInput` from the `Post` type.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, Eq, schemars::JsonSchema)]
pub struct Call {
#[serde(default, skip_serializing_if = "is_default")]
/// The name of the field on the `Query` type that you want to call. For instance `user`.
Expand Down

0 comments on commit 6b31712

Please sign in to comment.