Pinned Repositories
8dc738a2d02e463a
https://bsc.ide.black/GoodHut/Goodhut%E2%80%8B
app-ethereum
Ethereum wallet application for Ledger Blue and Nano S
blockbook
:blue_book: TREZOR address/account balance backend
codeql-go-nate158
The CodeQL extractor and libraries for Go.
fetchNate
A window.fetch JavaScript polyfill.
gentoo-haskell
official gentoo haskell overlay
go-opera-goodhut
Opera blockchain protocol secured by the Lachesis consensus algorithm
Goodhut
Goodhut
index-nate
Go modules by example is a series of work-along guides ![gqlgen](https://user-images.githubusercontent.com/980499/133180111-d064b38c-6eb9-444b-a60f-7005a6e68222.png) # gqlgen [![Integration](https://github.com/99designs/gqlgen/actions/workflows/integration.yml/badge.svg)](https://github.com/99designs/gqlgen/actions) [![Coverage Status](https://coveralls.io/repos/github/99designs/gqlgen/badge.svg?branch=master)](https://coveralls.io/github/99designs/gqlgen?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/99designs/gqlgen)](https://goreportcard.com/report/github.com/99designs/gqlgen) [![Go Reference](https://pkg.go.dev/badge/github.com/99designs/gqlgen.svg)](https://pkg.go.dev/github.com/99designs/gqlgen) [![Read the Docs](https://badgen.net/badge/docs/available/green)](http://gqlgen.com/) ## What is gqlgen? [gqlgen](https://github.com/99designs/gqlgen) is a Go library for building GraphQL servers without any fuss.<br/> - **gqlgen is based on a Schema first approach** — You get to Define your API using the GraphQL [Schema Definition Language](http://graphql.org/learn/schema/). - **gqlgen prioritizes Type safety** — You should never see `map[string]interface{}` here. - **gqlgen enables Codegen** — We generate the boring bits, so you can focus on building your app quickly. Still not convinced enough to use **gqlgen**? Compare **gqlgen** with other Go graphql [implementations](https://gqlgen.com/feature-comparison/) ## Quick start 1. [Initialise a new go module](https://golang.org/doc/tutorial/create-module) mkdir example cd example go mod init example 2. Add `github.com/99designs/gqlgen` to your [project's tools.go](https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module) printf '// +build tools\npackage tools\nimport _ "github.com/99designs/gqlgen"' | gofmt > tools.go go mod tidy 3. Initialise gqlgen config and generate models go run github.com/99designs/gqlgen init 4. Start the graphql server go run server.go More help to get started: - [Getting started tutorial](https://gqlgen.com/getting-started/) - a comprehensive guide to help you get started - [Real-world examples](https://github.com/99designs/gqlgen/tree/master/_examples) show how to create GraphQL applications - [Reference docs](https://pkg.go.dev/github.com/99designs/gqlgen) for the APIs ## Reporting Issues If you think you've found a bug, or something isn't behaving the way you think it should, please raise an [issue](https://github.com/99designs/gqlgen/issues) on GitHub. ## Contributing We welcome contributions, Read our [Contribution Guidelines](https://github.com/99designs/gqlgen/blob/master/CONTRIBUTING.md) to learn more about contributing to **gqlgen** ## Frequently asked questions ### How do I prevent fetching child objects that might not be used? When you have nested or recursive schema like this: ```graphql type User { id: ID! name: String! friends: [User!]! } ``` You need to tell gqlgen that it should only fetch friends if the user requested it. There are two ways to do this; - #### Using Custom Models Write a custom model that omits the friends field: ```go type User struct { ID int Name string } ``` And reference the model in `gqlgen.yml`: ```yaml # gqlgen.yml models: User: model: github.com/you/pkg/model.User # go import path to the User struct above ``` - #### Using Explicit Resolvers If you want to Keep using the generated model, mark the field as requiring a resolver explicitly in `gqlgen.yml` like this: ```yaml # gqlgen.yml models: User: fields: friends: resolver: true # force a resolver to be generated ``` After doing either of the above and running generate we will need to provide a resolver for friends: ```go func (r *userResolver) Friends(ctx context.Context, obj *User) ([]*User, error) { // select * from user where friendid = obj.ID return friends, nil } ``` You can also use inline config with directives to achieve the same result ```graphql directive @goModel(model: String, models: [String!]) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION directive @goField(forceResolver: Boolean, name: String) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION type User @goModel(model: "github.com/you/pkg/model.User") { id: ID! @goField(name: "todoId") friends: [User!]! @goField(forceResolver: true) } ``` ### Can I change the type of the ID from type String to Type Int? Yes! You can by remapping it in config as seen below: ```yaml models: ID: # The GraphQL type ID is backed by model: - github.com/99designs/gqlgen/graphql.IntID # a go integer - github.com/99designs/gqlgen/graphql.ID # or a go string ``` This means gqlgen will be able to automatically bind to strings or ints for models you have written yourself, but the first model in this list is used as the default type and it will always be used when: - Generating models based on schema - As arguments in resolvers There isn't any way around this, gqlgen has no way to know what you want in a given context. ## Other Resources - [Christopher Biscardi @ Gophercon UK 2018](https://youtu.be/FdURVezcdcw) - [Introducing gqlgen: a GraphQL Server Generator for Go](https://99designs.com.au/blog/engineering/gqlgen-a-graphql-server-generator-for-go/) - [Dive into GraphQL by Iván Corrales Solera](https://medium.com/@ivan.corrales.solera/dive-into-graphql-9bfedf22e1a) - [Sample Project built on gqlgen with Postgres by Oleg Shalygin](https://github.com/oshalygin/gqlgen-pg-todo-example)
training-kit
Open source courseware for Git and GitHub
GoodHut's Repositories
GoodHut/fetchNate
A window.fetch JavaScript polyfill.
GoodHut/aptos-core
Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
GoodHut/awesome-noir
A curated list of awesome things related to learning and programming in Noir.
GoodHut/Beeftext
A text snippet tool for Windows.
GoodHut/btp2-java
Java Contracts for BTP2
GoodHut/cli
GitHub’s official command line tool
GoodHut/cors-anywhere
CORS Anywhere is a NodeJS reverse proxy which adds CORS headers to the proxied request.
GoodHut/docs
The open-source repo for docs.github.com
GoodHut/expo
An open-source platform for making universal native apps with React. Expo runs on Android, iOS, and the web.
GoodHut/Front-End-Checklist
🗂 The perfect Front-End Checklist for modern websites and meticulous developers
GoodHut/furo
A clean customizable documentation theme for Sphinx
GoodHut/git-annex-remote-rclone
Use rclone supported cloud storage providers with git-annex
GoodHut/githubNate
:octocat: semantic-release plugin to publish a GitHub release and comment on released Pull Requests/Issues
GoodHut/Goodhut
Goodhut
GoodHut/HC-SR04
Basic sensor alarm system made with ESP8266 and HC-SR04.
GoodHut/LION
Latent Point Diffusion Models for 3D Shape Generation
GoodHut/migueltc13
GitHub profile
GoodHut/mvp
MVP for DigiCFA.
GoodHut/Nate158warn72
Spectacular Test Runner for JavaScript บทนำ 1.สวัสดีชาวโลก 2.ดึกดำบรรพ์ 3.ประเภทที่กำหนดเอง 4.การผูกตัวแปร 5.ประเภท 6.การแปลง 7.การแสดงออก 8.การไหลของการควบคุม 9.ฟังก์ชั่น 10.โมดูล 11.ลังไม้ 12.สินค้า 13.คุณสมบัติ 14.ยาสามัญ 15.กฎการกำหนดขอบเขต 15.1. ไร่ 15.2. กรรมสิทธิ์และการย้าย 15.3. การยืม 15.3.1. ความไม่แน่นอน 15.3.2. นามแฝง 15.3.3. รูปแบบการอ
GoodHut/noflix
Stream or download movies from the command line.
GoodHut/openai-translatorNate15872
基于 ChatGPT API 的划词翻译浏览器插件和跨平台桌面端应用 - Browser extension and cross-platform desktop application for translation based on ChatGPT API.
GoodHut/project-li1
Pacman game implemented in Haskell within Computer Labs I environment.
GoodHut/ScriptWorld
GoodHut/Surrealist
⚡ Powerful graphical SurrealDB query playground and database explorer for Browser and Desktop
GoodHut/TryHackMe
Master cybersecurity skills with this TryHackMe free path, includes a collection of my write-ups, solutions and progress tracking.
GoodHut/Unigram
Telegram for Windows
GoodHut/where-startups-trend
open source data for hackernoon's startup of the year by location contest: hundreds of thousands of votes for tens of thousands of startups in thousands of cities. https://app.gitbook.com/o/-Mb-rYMdapTqXb85Ss3r/s/-Mb-qqiO7y5bvTh6NRIL/
GoodHut/gearbox
ToscaWidgetsมิดเดิลแวร์ ¶ คลาสtw.core.middleware ToscaWidgetsMiddleware ( application , host_framework , prefix='/toscawidgets' , inject_resources=True , serve_resources=True , need_once=False , render_filter=None , callback_security_default=<function always_deny at 0xb74fa6bc> )
GoodHut/mailbox-browser
Web Interface for Mailbox
GoodHut/setuptools
Official project repository for the Setuptools build system