Solution: Postgres and Deno
Explore how to establish a PostgreSQL connection in Deno, define GraphQL types for a Car entity, and implement resolvers with queries and mutations. This lesson guides you through creating a functional GraphQL endpoint backed by PostgreSQL.
To solve this challenge, we need to follow the three steps given below.
Step1: Establishing a Postgres connection
First, we need to establish a Postgres connection and create the required table for the Car entity:
Explanation
- Lines 3–8: We define the Postgres connection.
- Line 10: We connect to the Postgres database.
- Line 13: