-
Notifications
You must be signed in to change notification settings - Fork 259
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
feat(390): Add JSONPlaceholder configurations #2741
feat(390): Add JSONPlaceholder configurations #2741
Conversation
Action required: PR inactive for 5 days. |
Thanks @onyedikachi-david ! I tried running the configuration as above and got these errors:
|
Moving to draft to reduce noise and improve CI efficiency. Once you are ready just mark it as "ready to review". Feel free to give a shoutout on the #contributors channel on Discord if you want immediate attention. |
Signed-off-by: David Anyatonwu <[email protected]>
…thub.com/onyedikachi-david/tailcall into examples/update-jsonplaceholder-examples fixes tailcall check failure for updated examples.
Thanks for your review sir. Just fixed it. |
# Fetch a post by ID | ||
post(id: Int!): Post @http(path: "/posts/{{.args.id}}") | ||
# Fetch all posts by a specific user | ||
posts(user: Int!): [Post] @http(path: "/posts?userId={{.args.user}}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
posts(user: Int!): [Post] @http(path: "/posts?userId={{.args.user}}") | |
posts(userId: Int): [Post] @http(path: "/posts?userId={{.args.user}}") |
User should be optional. This is true for all the types that return a list of values. Please update the arguments and drop required.
# Fetch a comment by ID | ||
comment(id: Int!): Comment @http(path: "/comments/{{.args.id}}") | ||
# Fetch all comments on a specific post | ||
comments(post: Int!): [Comment] @http(path: "/comments?postId={{.args.post}}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments(post: Int!): [Comment] @http(path: "/comments?postId={{.args.post}}") | |
comments(postId: Int, email: String): [Comment] @http(path: "/comments?postId={{.args.post}}") |
# Define the Mutation type with various fields for creating, updating, and deleting resources | ||
type Mutation { | ||
# Create a new post | ||
createPost(input: PostInput!): Post @http(method: "POST", path: "/posts", body: "{{.args.input}}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createPost(input: PostInput!): Post @http(method: "POST", path: "/posts", body: "{{.args.input}}") | |
createPost(input: PostInput!): Post @http(method: POST, path: "/posts", body: "{{.args.input}}") |
Methods are not set in string. They are enums.
Moving to draft to reduce noise and improve CI efficiency. Once you are ready just mark it as "ready to review". Feel free to give a shoutout on the #contributors channel on Discord if you want immediate attention. |
Action required: PR inactive for 5 days. |
PR closed after 10 days of inactivity. |
Summary:
Add JSONPlaceholder example configurations for GraphQL, YAML, and JSON formats.
Issue Reference(s):
Related to tailcallhq/tailcallhq.github.io#390
Build & Testing:
cargo test
successfully../lint.sh --mode=fix
to fix all linting issues raised by./lint.sh --mode=check
.Checklist:
<type>(<optional scope>): <title>
Additional Context:
This PR adds example configurations for the JSONPlaceholder API as discussed in tailcallhq/tailcallhq.github.io#390. These examples demonstrate how to set up a Tailcall configuration for a complex API with multiple interconnected resources.
The configurations are added in three formats:
examples/jsonplaceholder.graphql
examples/jsonplaceholder.yml
examples/jsonplaceholder.json
These examples will be referenced in the documentation (tailcallhq/tailcallhq.github.io) to provide users with a comprehensive starting point for using Tailcall with a real-world API.