Closed Hardeepex closed 9 months ago
2786efd10a
)The sandbox appears to be unavailable or down.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
src/fragments/queries.ts
✓ https://github.com/Hardeepex/juicybabencmz/commit/ee6f579406b16920503baf572990c36c236dabd5 Edit
Modify src/fragments/queries.ts with contents:
• Add a new GraphQL query named `GET_PROFESSIONALS` to fetch the `professional` custom post type. This query should fetch the necessary fields such as `title`, `uri`, `link`, `content`, `categories`, and `slug`.
• The query should look like this: ```typescript export const GET_PROFESSIONALS = gql` query GetProfessionals { professionals { nodes { title uri link content categories { nodes { name slug taxonomyName uri } } slug } } } `; ```
--- +++ @@ -211,6 +211,28 @@ } `); +export const GET_PROFESSIONALS = gql` + query GetProfessionals { + professionals { + nodes { + title + uri + link + content + categories { + nodes { + name + slug + taxonomyName + uri + } + } + slug + } + } + } +`; + export const QUERY_MUTATION_DELETE_COMMENT_BY_ID = gql(/* GraphQL */ ` mutation MutationDeleteCommentById($id: ID = "") { deleteComment(input: { id: $id }) {
src/fragments/queries.ts
✓ Edit
Check src/fragments/queries.ts with contents:
Ran GitHub Actions for ee6f579406b16920503baf572990c36c236dabd5:
src/container/singles/single/SingleProfessional.tsx
✓ https://github.com/Hardeepex/juicybabencmz/commit/341854e82f642393e07d701d0e3cd14b32adf797 Edit
Create src/container/singles/single/SingleProfessional.tsx with contents:
• Create a new component named `SingleProfessional` in the `src/container/singles/single` directory.
• This component should be similar to the `SingleType1` component and should be responsible for displaying a single `professional`.
• Import the necessary components and hooks from the relevant files.
• Use the `GET_PROFESSIONALS` query to fetch the `professional` data and display it using the imported components.
src/container/singles/single/SingleProfessional.tsx
✓ Edit
Check src/container/singles/single/SingleProfessional.tsx with contents:
Ran GitHub Actions for 341854e82f642393e07d701d0e3cd14b32adf797:
src/wp-templates/professional.tsx
✓ https://github.com/Hardeepex/juicybabencmz/commit/802a289760d00af6d60209fa8493354d64fd084f Edit
Create src/wp-templates/professional.tsx with contents:
• Create a new template named `professional.tsx` in the `src/wp-templates` directory.
• This template should be similar to `single.tsx` and should be responsible for fetching and displaying a single `professional` page.
• Import the `SingleProfessional` component and the `GET_PROFESSIONALS` query.
• Use the `GET_PROFESSIONALS` query to fetch the `professional` data and pass it to the `SingleProfessional` component to display it.
src/wp-templates/professional.tsx
✓ Edit
Check src/wp-templates/professional.tsx with contents:
Ran GitHub Actions for 802a289760d00af6d60209fa8493354d64fd084f:
I have finished reviewing the code for completeness. I did not find errors for sweep/fetch_the_data_from_professional_custom
.
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord
sweep: is there any other file where we have to update about this professional custom post type in codebase in this repo and if not please start the designing process with tailwind i need simple card type design with tailwind
I have the custom post type professional in my wordpress website https://juicytalent.com, i am using graphql for fetching the data .
To fetch and display your custom post type
professional
, you can follow the same pattern used for posts in these files. You would need to:fragments/queries.ts
.src/container
(similar toSingleType1
insingle/single.tsx
) that displays a single professional.wp-templates
(similar tosingle.tsx
) that fetches and displays a single professional page.Remember to update the GraphQL fragments and queries as needed to fetch the correct fields for your
professional
custom post type.import { gql } from "@/generated";
// ... other queries
export const GET_PROFESSIONALS = gql
query GetProfessionals { professionals { nodes { title uri link content categories { nodes { name slug taxonomyName uri } } slug } } }
;// ... other queries and mutations
Checklist
- [X] Modify `src/fragments/queries.ts` ✓ https://github.com/Hardeepex/juicybabencmz/commit/ee6f579406b16920503baf572990c36c236dabd5 [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/fragments/queries.ts) - [X] Running GitHub Actions for `src/fragments/queries.ts` ✓ [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/fragments/queries.ts) - [X] Create `src/container/singles/single/SingleProfessional.tsx` ✓ https://github.com/Hardeepex/juicybabencmz/commit/341854e82f642393e07d701d0e3cd14b32adf797 [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/container/singles/single/SingleProfessional.tsx) - [X] Running GitHub Actions for `src/container/singles/single/SingleProfessional.tsx` ✓ [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/container/singles/single/SingleProfessional.tsx) - [X] Create `src/wp-templates/professional.tsx` ✓ https://github.com/Hardeepex/juicybabencmz/commit/802a289760d00af6d60209fa8493354d64fd084f [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/wp-templates/professional.tsx) - [X] Running GitHub Actions for `src/wp-templates/professional.tsx` ✓ [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/wp-templates/professional.tsx)