Skip to content

fix(backend): unmarshal Kickstarter GraphQL pid as json.Number#7

Merged
Jing-yilin merged 1 commit into
developfrom
fix/graphql-pid-type
Feb 27, 2026
Merged

fix(backend): unmarshal Kickstarter GraphQL pid as json.Number#7
Jing-yilin merged 1 commit into
developfrom
fix/graphql-pid-type

Conversation

@Jing-yilin
Copy link
Copy Markdown
Contributor

Kickstarter's GraphQL API returns pid as a JSON number (e.g. 12345), but the Go struct declared it as string, causing all /api/campaigns and search calls to fail with:

json: cannot unmarshal number into Go struct field .data.projects.nodes.pid of type string

Fix: Change PID field type to json.Number and call .String() when mapping to the model.

Kickstarter returns pid as a JSON number, not a string.
Using json.Number handles both formats and converts to string via .String().
@Jing-yilin Jing-yilin merged commit 09a2d26 into develop Feb 27, 2026
2 checks passed
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.

1 participant