
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
github.com/machinebox/graphql
Low-level GraphQL client for Go.
context.Context
timeouts and cancellationMake sure you have a working Go environment. To install graphql, simply run:
$ go get github.com/machinebox/graphql
import "context"
// create a client (safe to share across requests)
client := graphql.NewClient("https://machinebox.io/graphql")
// make a request
req := graphql.NewRequest(`
query ($key: String!) {
items (id:$key) {
field1
field2
field3
}
}
`)
// set any variables
req.Var("key", "value")
// set header fields
req.Header.Set("Cache-Control", "no-cache")
// define a Context for the request
ctx := context.Background()
// run it and capture the response
var respData ResponseStruct
if err := client.Run(ctx, req, &respData); err != nil {
log.Fatal(err)
}
By default, the package will send a JSON body. To enable the sending of files, you can opt to
use multipart form data instead using the UseMultipartForm
option when you create your Client
:
client := graphql.NewClient("https://machinebox.io/graphql", graphql.UseMultipartForm())
For more information, read the godoc package documentation or the blog post.
Thanks to Chris Broadfoot for design help.
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.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.