https://github.com/mfkimbell/go-graphql-server
https://github.com/mfkimbell/go-graphql-server
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mfkimbell/go-graphql-server
- Owner: mfkimbell
- Created: 2024-08-12T23:09:03.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-12T23:38:35.000Z (11 months ago)
- Last Synced: 2025-01-22T22:31:18.430Z (6 months ago)
- Language: Go
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Mutation: `createDog(input: NewDog): Dog!`

### MongoDB Database:

### Query: `dogs: [Dog!]!`

### Query: `dog(_id: String!): Dog!`

### Issues that arose:
* make sure you have MongoDB installed on your pc... smh
* make sure your imports are correct
* make sure your data is structured correctly in the schema
* its standard to make an input type for every unique mutation### Imporant to know:
#### GraphQL Schema:
Defines the structure of the GraphQL API, including types, queries, and mutations. It acts as a contract between the client and the server, specifying what data can be queried or mutated.
#### Resolvers:
Resolvers actually hold the logic for connecting to the database and grabbing the desired data and returning it in the desired state. In this case, I wrote most of the logic in my "Database" package.
#### Types:
Define the shape of the data. For example, Dog specifies fields like _id, name, and isGoodBoi.
#### Queries:
Define read operations that clients can perform, such as fetching a Dog by ID or retrieving a list of dogs.
#### Mutations:
Define write operations that clients can perform, such as creating a new Dog.
#### Models:
help map locally created objects to the database (The models in this project are created automatically by gqlgen library)