fix(search): register searchContent and searchCreator resolvers and add missing schema types#328
Conversation
…dd missing schema types
✅ Deploy Preview for quotevote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
flyblackbox
left a comment
There was a problem hiding this comment.
Thank you so much @Anton-dev3306 great work! FYI @Om7035 and @motirebuma
|
@Anton-dev3306 it did not seem to work in production or deploy preview.. can you check? |
@flyblackbox Yes, I'll check this out. |
@flyblackbox Thanks for the update! Since Railway has already deployed the changes, |
|
You're right @Anton-dev3306, it's Railway. It failed there, check the diagnosis log: Create a root .npmrc file with legacy-peer-deps=true to fix the build. The build fails because Nixpacks runs npm i, which hits an ERESOLVE peer dependency conflict: the client workspace requires react@17.0.2 but @livechat/ui-kit@0.3.0-7 demands react@^16.3.0. The project already uses --legacy-peer-deps in its install:all script, but Nixpacks does not pick that up automatically. |
|
@flyblackbox Looking at the logs, this build failure seems to be a pre-existing Railway's diagnosis actually suggests adding a |
|
@Anton-dev3306 can this fix it? Your review would be a big help! #330 |
|
@flyblackbox It was just a minor convention issue and shouldn't affect |
|
I don't know how to fix this, and do not fully understand the issue or solution. @Anton-dev3306 |
|
@flyblackbox No problem, I may have a fix for this — adding a |
|
@flyblackbox So, should I proceed? |
|
Yes please do, I will ask another dev to review. @Anton-dev3306 |
|
@flyblackbox Perfect. |
|
@flyblackbox so probably this is the solution #331 |
|
Okay got it @Anton-dev3306 thank you for all the help! 🙏 |

Description
This PR fixes the
Response not successful: Received status code 400error on the Search page (Issue #327).The
SEARCHquery inclient/src/graphql/query.jsxcallssearchContentandsearchCreator, but neither was registered in the GraphQL schema or inresolver_query. The server had no knowledge of these queries, causing every search request to fail with a 400.Additionally, the
ContentandCreatorGraphQL types were missing from the schema entirely, so even if the queries had been registered, the server would have rejected them.Changes
server/app/data/types/Content.js: AddedContentGraphQL type based onContentModelschema.server/app/data/types/Creator.js: AddedCreatorGraphQL type based onCreatorModelschema.server/app/data/types/index.js: Exported the two new types.server/app/data/type_definition/query_definition.js: RegisteredsearchContent(text: String!): [Content]andsearchCreator(text: String!): [Creator].server/app/data/resolvers/queries.js: ImportedcontentQueryandcreatorQueryand registered both resolvers inresolver_query.Verification
searchContentandsearchCreatorare now resolvable queries in the GraphQL schema.Related Issue
Fixes #327