Skip to content

fix(search): register searchContent and searchCreator resolvers and add missing schema types#328

Merged
flyblackbox merged 1 commit into
QuoteVote:mainfrom
Anton-dev3306:fix/search-content-creator-schema
May 9, 2026
Merged

fix(search): register searchContent and searchCreator resolvers and add missing schema types#328
flyblackbox merged 1 commit into
QuoteVote:mainfrom
Anton-dev3306:fix/search-content-creator-schema

Conversation

@Anton-dev3306
Copy link
Copy Markdown
Contributor

Description

This PR fixes the Response not successful: Received status code 400 error on the Search page (Issue #327).

The SEARCH query in client/src/graphql/query.jsx calls searchContent and searchCreator, but neither was registered in the GraphQL schema or in resolver_query. The server had no knowledge of these queries, causing every search request to fail with a 400.

Additionally, the Content and Creator GraphQL types were missing from the schema entirely, so even if the queries had been registered, the server would have rejected them.

Changes

  • Created server/app/data/types/Content.js: Added Content GraphQL type based on ContentModel schema.
  • Created server/app/data/types/Creator.js: Added Creator GraphQL type based on CreatorModel schema.
  • Updated server/app/data/types/index.js: Exported the two new types.
  • Updated server/app/data/type_definition/query_definition.js: Registered searchContent(text: String!): [Content] and searchCreator(text: String!): [Creator].
  • Updated server/app/data/resolvers/queries.js: Imported contentQuery and creatorQuery and registered both resolvers in resolver_query.

Verification

  • Confirmed the server starts without schema validation errors after the changes.
  • Confirmed searchContent and searchCreator are now resolvable queries in the GraphQL schema.
  • Search requests no longer return a 400 status code.

Related Issue

Fixes #327

@netlify
Copy link
Copy Markdown

netlify Bot commented May 9, 2026

Deploy Preview for quotevote ready!

Name Link
🔨 Latest commit e4ede07
🔍 Latest deploy log https://app.netlify.com/projects/quotevote/deploys/69ff8e5dafd562ebc2c2b317
😎 Deploy Preview https://deploy-preview-328--quotevote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@flyblackbox flyblackbox requested review from Om7035 and motirebuma May 9, 2026 19:12
Copy link
Copy Markdown
Contributor

@flyblackbox flyblackbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @Anton-dev3306 great work! FYI @Om7035 and @motirebuma

@flyblackbox flyblackbox merged commit e65742d into QuoteVote:main May 9, 2026
4 checks passed
@flyblackbox
Copy link
Copy Markdown
Contributor

@Anton-dev3306 it did not seem to work in production or deploy preview.. can you check?

@Anton-dev3306
Copy link
Copy Markdown
Contributor Author

Anton-dev3306 commented May 9, 2026

@Anton-dev3306 it did not seem to work in production or deploy preview.. can you check?

@flyblackbox Yes, I'll check this out.

@Anton-dev3306
Copy link
Copy Markdown
Contributor Author

Anton-dev3306 commented May 9, 2026

@Anton-dev3306 it did not seem to work in production or deploy preview.. can you check?

@flyblackbox Thanks for the update! Since Railway has already deployed the changes,
could you share the Railway logs? That would help identify why the 400
is still occurring.

@flyblackbox
Copy link
Copy Markdown
Contributor

flyblackbox commented May 9, 2026

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.

image

@Anton-dev3306
Copy link
Copy Markdown
Contributor Author

@flyblackbox Looking at the logs, this build failure seems to be a pre-existing
peer dependency conflict between react@17 and @livechat/ui-kit — it looks
like the same issue from the failed deploy last week (fix: add @babel/core
for deployment), so it may not be related to these changes.

Railway's diagnosis actually suggests adding a .npmrc file at the root
with legacy-peer-deps=true so Nixpacks picks it up automatically.

@flyblackbox
Copy link
Copy Markdown
Contributor

flyblackbox commented May 9, 2026

@Anton-dev3306 can this fix it? Your review would be a big help! #330

@Anton-dev3306
Copy link
Copy Markdown
Contributor Author

@flyblackbox It was just a minor convention issue and shouldn't affect
functionality. most likely the real blocker is the peer dependency conflict shown in the Railway logs — Nixpacks running npm install without --legacy-peer-deps
is what's preventing the build from completing. Once that's resolved, the
deploy should go through and we can verify the search fix in production.

@flyblackbox
Copy link
Copy Markdown
Contributor

I don't know how to fix this, and do not fully understand the issue or solution. @Anton-dev3306

@Anton-dev3306
Copy link
Copy Markdown
Contributor Author

@flyblackbox No problem, I may have a fix for this — adding a .npmrc file at the monorepo root with legacy-peer-deps=true so Nixpacks picks it up automatically during the Railway build. I'll open a separate PR for that.,

@Anton-dev3306
Copy link
Copy Markdown
Contributor Author

@flyblackbox So, should I proceed?

@flyblackbox
Copy link
Copy Markdown
Contributor

flyblackbox commented May 10, 2026

Yes please do, I will ask another dev to review. @Anton-dev3306

@Anton-dev3306
Copy link
Copy Markdown
Contributor Author

@flyblackbox Perfect.

@Anton-dev3306
Copy link
Copy Markdown
Contributor Author

Anton-dev3306 commented May 10, 2026

@flyblackbox so probably this is the solution #331

@flyblackbox
Copy link
Copy Markdown
Contributor

flyblackbox commented May 10, 2026

Okay got it @Anton-dev3306 thank you for all the help! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search Results Error 400

2 participants