
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
github.com/owllaboratory/graphql_mongodb_golang_server
Since a few months I was curious to discover two new concepts: Golang and GraphQL A few days ago, I started to create my own GraphQL Golang server with MongoDB as a database.
I'm pretty sure it will help some people understand how a Golang GraphQL server works.
Of course I have very little experience under these two technologies, so I do not guarantee anything.
git clone https://github.com/OwlLaboratory/graphql_mongodb_golang_server $HOME/go/src/github.com/OwlLaboratory/graphql_mongodb_golang_server
cd $HOME/go/src/github.com/OwlLaboratory/graphql_mongodb_golang_server/
go get ./...
go build server.go
./server
Then: open http://localhost:8080
For the server part I based on the neelance server (he is the main creator of GopherJS)
For the ODM I based on mongodm (which I slightly modified)
MongoDB is configured on localhost:27017 by default (you can change config in mongo.go)
I try to follow some best practices and implement a CLEAR architecture for a module
I implemented a simple CRUD on a Mongo collection called "Channel" and defined like this:
{
id: ObjectID,
name: string,
platform {
name: string
},
created: MongoDate
updated: MongoDate
}
channel(id: String!): Channel
channels(first: Int, offset: Int): [Channel]
createChannel(input: CreateChannelInput!): Channel
updateChannel(input: UpdateChannelInput!): Channel
deleteChannel(input: DeleteChannelInput!): Channel
mutation createChannel {
createChannel(input: {channel: {name: "Channel 1", platform: {name: "Platform for channel 1"}}}) {
id
name
platform {
name
}
}
}
mutation updateChannel {
updateChannel(input: {id: "5a9b13a7e1382307023003d7", patch: {platform: {name: "Yolo"}}}) {
name
platform {
name
}
}
}
mutation deleteChannel {
deleteChannel(input: {id: "5a9b13a7e1382307023003d7"}) {
name
}
}
{
channels(first: 1, offset: 1) {
id
name
}
}
{
channel(id: "5a9b13a7e1382307023003d7") {
name
platform {
name
}
}
}
I tried to implement a clear architecture rather than storing everything in a "models" package
Each collection is represented as an independent package containing all the resources needed for GraphQL Server.
git clone https://github.com/OwlLaboratory/graphql_mongodb_golang_server $HOME/go/src/github.com/OwlLaboratory/graphql_mongodb_golang_server
cd $HOME/go/src/github.com/OwlLaboratory/graphql_mongodb_golang_server/
go get ./...
go build server.go
./server
Then: open http://localhost:8080
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.