'How to connect between Graphql and GORM in Golang?

I am just getting started learning the Golang language. During making the personal practice, I tried to connect my GORM DB to GraphQL. However, I am not sure how to connect between them. When I google it, I mainly refer these two; https://www.soberkoder.com/go-graphql-api-mysql-gorm/, and https://ver-1-0.net/en/2019/05/13/gin-gorm-gqlgen-crud.

The first one, I guess he/she tried to DB connection in server.go and I followed his/her direction but I am not sure how the handler.Playground and hanlder.GraphQL works it should be playground.Handler and where does this "go_orders_graphql_api" come from..

The second one, tried to connect in gqlgen.yml and I also tried to follow it but not work...

Does anyone know how to connect GORM and GraphQL? I really appreciate your helP!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source