Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename "example" dir to "_examples" #1734

Merged
merged 3 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/codegen/templates/data.go linguist-generated
/example/dataloader/*_gen.go linguist-generated
/_examples/dataloader/*_gen.go linguist-generated
generated.go linguist-generated
4 changes: 2 additions & 2 deletions .github/workflows/check-coverage
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
set -euo pipefail
GO111MODULE=off go get github.com/mattn/goveralls

go test -covermode atomic -coverprofile=/tmp/coverage.out -coverpkg=./... $(go list github.com/99designs/gqlgen/... | grep -v example)
goveralls -coverprofile=/tmp/coverage.out -service=github -ignore='example/*/*,example/*/*/*,integration/*,integration/*/*,codegen/testserver/*/*,plugin/federation/testdata/*/*/*,*/generated.go,*/*/generated.go,*/*/*/generated.go,graphql/executable_schema_mock.go'
go test -covermode atomic -coverprofile=/tmp/coverage.out -coverpkg=./... $(go list github.com/99designs/gqlgen/... | grep -v _examples)
goveralls -coverprofile=/tmp/coverage.out -service=github -ignore='_examples/*/*,_examples/*/*/*,integration/*,integration/*/*,codegen/testserver/*/*,plugin/federation/testdata/*/*/*,*/generated.go,*/*/generated.go,*/*/*/generated.go,graphql/executable_schema_mock.go'
2 changes: 1 addition & 1 deletion .github/workflows/check-federation
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

cd example/federation
cd _examples/federation

./start.sh &

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-fmt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

go fmt ./...
cd example && go fmt ./...
cd _examples && go fmt ./...
if [[ $(git --no-pager diff) ]] ; then
echo "you need to run "go fmt" and commit the changes"
git --no-pager diff
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-generate
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

go generate ./...
cd example && go generate ./...
cd _examples && go generate ./...
if [[ $(git --no-pager diff) ]] ; then
echo "you need to run "go generate ./..." and commit the changes"
git --no-pager diff
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-init
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

cd example/init
cd _examples/init

go get -d github.com/99designs/gqlgen@master

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v1
- run: apk add --no-cache --no-progress nodejs npm git bash
- run: go mod download
- run: cd example/federation ; npm install
- run: cd _examples/federation ; npm install
- run: .github/workflows/check-federation

init:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
with:
go-version: ${{ matrix.go }}
- run: go mod download && go test -race ./...
- run: cd example && go mod download && go test -race ./...
- run: cd _examples && go mod download && go test -race ./...
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/vendor
/docs/public
/docs/.hugo_build.lock
/example/chat/node_modules
/_examples/chat/node_modules
/integration/node_modules
/integration/schema-fetched.graphql
/example/chat/package-lock.json
/example/federation/package-lock.json
/example/federation/node_modules
/_examples/chat/package-lock.json
/_examples/federation/package-lock.json
/_examples/federation/node_modules
/codegen/gen
/gen

Expand Down
24 changes: 12 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Also added `go:generate` in federation entity resolver tests to make it simpler

To test:
```
go generate ./... && cd example/ && go generate ./... && cd ..
go generate ./... && cd _examples/ && go generate ./... && cd ..
go test -race ./... && cd example && go test -race ./... && cd ..
```

Expand Down Expand Up @@ -341,7 +341,7 @@ To run tests:

* removed unused const in tests

* Update example/chat/readme.md
* Update _examples/chat/readme.md

</details></dd></dl>

Expand Down Expand Up @@ -867,8 +867,8 @@ listed in a few example readmes [2]. Using relative paths from the
respective example directory should be clear enough.

[2]:
example/todo/server/server.go:10:2: no required module provides package github.com/99designs/gqlgen/example/todo; to add it:
go get github.com/99designs/gqlgen/example/todo
_examples/todo/server/server.go:10:2: no required module provides package github.com/99designs/gqlgen/_examples/todo; to add it:
go get github.com/99designs/gqlgen/_examples/todo

</details></dd></dl>

Expand Down Expand Up @@ -5071,10 +5071,10 @@ Performance improvments

goos: linux
goarch: amd64
pkg: github.com/99designs/gqlgen/example/starwars
pkg: github.com/99designs/gqlgen/_examples/starwars
BenchmarkSimpleQueryNoArgs-8 300000 25093 ns/op 6453 B/op 114 allocs/op
PASS
ok github.com/99designs/gqlgen/example/starwars 10.807s
ok github.com/99designs/gqlgen/_examples/starwars 10.807s

</details></dd></dl>

Expand All @@ -5083,10 +5083,10 @@ ok github.com/99designs/gqlgen/example/starwars 10.807s
go test -benchtime=5s -bench=. -benchmem
goos: linux
goarch: amd64
pkg: github.com/99designs/gqlgen/example/starwars
pkg: github.com/99designs/gqlgen/_examples/starwars
BenchmarkSimpleQueryNoArgs-8 200000 32125 ns/op 6277 B/op 118 allocs/op
PASS
ok github.com/99designs/gqlgen/example/starwars 9.768s
ok github.com/99designs/gqlgen/_examples/starwars 9.768s

</details></dd></dl>

Expand All @@ -5095,10 +5095,10 @@ ok github.com/99designs/gqlgen/example/starwars 9.768s
go test -benchtime=5s -bench=. -benchmem
goos: linux
goarch: amd64
pkg: github.com/99designs/gqlgen/example/starwars
pkg: github.com/99designs/gqlgen/_examples/starwars
BenchmarkSimpleQueryNoArgs-8 200000 32680 ns/op 6357 B/op 126 allocs/op
PASS
ok github.com/99designs/gqlgen/example/starwars 9.901s
ok github.com/99designs/gqlgen/_examples/starwars 9.901s

</details></dd></dl>

Expand Down Expand Up @@ -8187,7 +8187,7 @@ package "query" does not depend on "schema" any more

- <a href="https://github.com/99designs/gqlgen/commit/1a959516cacda256f52b3ba2f5cf2e7fd03c85da"><tt>1a959516</tt></a> refactor

- <a href="https://github.com/99designs/gqlgen/commit/f8cb11c10ab15ad4a547a1695efe538a7b5209a8"><tt>f8cb11c1</tt></a> example/starwars: use interface base type to make type assertions nicer
- <a href="https://github.com/99designs/gqlgen/commit/f8cb11c10ab15ad4a547a1695efe538a7b5209a8"><tt>f8cb11c1</tt></a> _examples/starwars: use interface base type to make type assertions nicer

- <a href="https://github.com/99designs/gqlgen/commit/746da4b8e1dff2ec72167060487e1441506a97c3"><tt>746da4b8</tt></a> star wars example: friendsConnection

Expand Down Expand Up @@ -8315,7 +8315,7 @@ This reverts commit fb3a6fc969b0c8c286c7d024a108f5696627639c.

- <a href="https://github.com/99designs/gqlgen/commit/d70d16c4ebc4a9a8513ccab945b4e0ad77de6cfe"><tt>d70d16c4</tt></a> added server example

- <a href="https://github.com/99designs/gqlgen/commit/6f9a89db8ecf538d72ece47158d2ef7f487d8a06"><tt>6f9a89db</tt></a> separate example/starwars package
- <a href="https://github.com/99designs/gqlgen/commit/6f9a89db8ecf538d72ece47158d2ef7f487d8a06"><tt>6f9a89db</tt></a> separate _examples/starwars package

- <a href="https://github.com/99designs/gqlgen/commit/e4060db594dbd7ca6a98e7bb9cf967b6bc51e063"><tt>e4060db5</tt></a> added support for directives

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Still not convinced enough to use **gqlgen**? Compare **gqlgen** with other Go g

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/example) show how to create GraphQL applications
- [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
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions _examples/chat/.gqlgen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
models:
Chatroom:
model: github.com/99designs/gqlgen/_examples/chat.Chatroom
File renamed without changes.
18 changes: 9 additions & 9 deletions example/chat/generated.go → _examples/chat/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/99designs/gqlgen/graphql/playground"

"github.com/99designs/gqlgen/example/chat"
"github.com/99designs/gqlgen/_examples/chat"
"github.com/99designs/gqlgen/graphql/handler"
"github.com/gorilla/websocket"
"github.com/opentracing/opentracing-go"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# .gqlgen.yml example
# .gqlgen.yml _examples
#
# Refer to https://gqlgen.com/config/
# for detailed .gqlgen.yml documentation.
Expand Down
28 changes: 14 additions & 14 deletions example/config/generated.go → _examples/config/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading