Skip to content

Commit

Permalink
Add vercel edge function
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorblades committed Dec 27, 2023
1 parent f6f33ba commit d4032c0
Show file tree
Hide file tree
Showing 5 changed files with 1,194 additions and 39 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
.vercel
7 changes: 7 additions & 0 deletions api/graphql.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { yoga } from "../src/graphql";

export const config = {
runtime: "edge",
};

export default yoga;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
"vercel": "^33.0.1",
"wrangler": "^3.1.1"
}
}
2 changes: 1 addition & 1 deletion src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ builder.objectType(CountryRef, {
},
resolve: async (country, { lang }) => {
if (lang) {
return getName(country.code, lang);
return getName(country.code, lang) ?? country.name;
}

return country.name;
Expand Down
Loading

0 comments on commit d4032c0

Please sign in to comment.