Commit Graph
58 Commits
Author SHA1 Message Date
Ben KraftandGitHub 4a06e3f28e Fix typo in README (#58)
## Test plan
read it

Author: benjaminjkraft

Reviewers: aberkan, dnerdy, MiguelCastillo

Required Reviewers: 

Approved by: aberkan

Checks:  Test (1.17),  Test (1.16),  Test (1.15),  Test (1.14),  Test (1.13),  Lint,  Test (1.17),  Test (1.16),  Test (1.15),  Test (1.14),  Test (1.13),  Lint

Pull request URL: https://github.com/Khan/genqlient/pull/58
2021-08-24 10:20:59 -07:00
Ben KraftandGitHub 3746ecd063 Add integration tests against a gqlgen server (#50)
## Summary:
We have lots of tests covering codegen, but not a lot that actually run
the code.  For things where all we do is generate types, that's (mostly)
fine (especially now that we actually build the code), but as we
generate more nontrivial non-type code we need to actually run it.

So I wrote some integration tests that spin up a little gqlgen
server, and make calls to it; we can add more over time especially as
the JSON marshalling logic gets complex (to support fragments).
They're more work to write than the snapshot tests, but of course they
can test a lot more.

In addition to gqlgen, I pulled in testify assert/require, because I
really wanted to be able to use assert.Equal and such for these.  I
didn't bother converting existing tests, although I assume they will
become useful elsewhere in time.  Both gqlgen and testify are of course
only used in tests.

Fixes #21 and #24.
Issue: https://github.com/Khan/genqlient/issues/21
Issue: https://github.com/Khan/genqlient/issues/24

## Test plan:
make check

Author: benjaminjkraft

Reviewers: aberkan, dnerdy, benjaminjkraft, csilvers, MiguelCastillo

Required Reviewers: 

Approved by: aberkan, dnerdy

Checks:  Test (1.17),  Test (1.16),  Test (1.15),  Test (1.14),  Test (1.13),  Lint,  Test (1.17),  Test (1.16),  Test (1.15),  Test (1.14),  Test (1.13),  Lint

Pull request URL: https://github.com/Khan/genqlient/pull/50
2021-08-20 10:54:41 -07:00
Ben KraftandGitHub 700392315a Enable golangci-lint (#49)
## Summary:
It would be nice to have some linting beyond `go vet`!  Now we do.  I
started by copying the config from Khan/webapp.  I did remove a couple
of staticcheck checks that I didn't feel were useful.  (Note also that
exportloopref is the replacement for scopelint in newer golangci-lint.)

Included are all the needed lint fixes; most are stylistic but the
changes in the example are a (minor) bugfix.

Fixes #22.
Issue: https://github.com/Khan/genqlient/issues/22

## Test plan:
make check

Author: benjaminjkraft

Reviewers: aberkan, dnerdy, benjaminjkraft, csilvers, MiguelCastillo

Required Reviewers: 

Approved by: aberkan, dnerdy

Checks:  Test (1.17),  Test (1.16),  Test (1.15),  Test (1.14),  Test (1.13),  Lint,  Test (1.17),  Test (1.16),  Test (1.15),  Test (1.14),  Test (1.13),  Lint

Pull request URL: https://github.com/Khan/genqlient/pull/49
2021-08-20 10:39:12 -07:00
Ben Kraft b399e0d740 move TODOs into issues 2021-04-21 19:05:38 -07:00
Ben Kraft 288657fcb9 TODOs 2021-04-16 11:55:35 -07:00
Ben Kraft 74411faf52 TODO: auto-caching 2021-04-09 12:18:09 -07:00
Ben Kraft 16523c1f81 add omitempty 2021-04-09 11:51:30 -07:00
Ben Kraft 25a2b45ccc redo comment parsing to set up for field-level config 2021-04-09 09:53:53 -07:00
Ben Kraft b4e8316c6a add support for custom scalars -- mainly adding proper import machinery 2021-04-08 13:07:31 -07:00
Ben Kraft e68787ad35 add TODO 2021-04-08 11:28:10 -07:00
Ben KraftandGitHub eae8553c04 couple more TODOs 2021-04-06 15:49:52 -07:00
Ben KraftandGitHub a33595b4b3 update & reorganize TODOs 2021-04-06 15:44:03 -07:00
Ben Kraft e7d9c7d140 update repo to match official open source guidelines 2021-04-06 12:29:28 -07:00
Ben Kraft 28dfeb5b46 more notes on testing 2021-04-02 18:08:13 -07:00
Ben Kraft 9c8cf02181 proper test wiring for example test in github actions 2021-04-02 18:04:05 -07:00
Ben Kraft 21954ac62d general pass of README cleanup 2021-04-02 17:01:49 -07:00
Ben Kraft 0432f3f434 miscellaneous test coverage 2021-04-02 16:34:15 -07:00
Ben Kraft 4669ea00d0 TODOs 2021-04-02 16:26:22 -07:00
Ben Kraft fbf00f3bef add option to export all operations 2021-04-01 13:11:23 -07:00
Ben Kraft eae68e43c9 allow globbing, and extract queries from .go files 2021-04-01 12:34:51 -07:00
Ben KraftandGitHub 10ae5ff5d8 formatting 2021-03-31 18:09:50 -07:00
Ben Kraft 27ee3c2dbd fixes while integrating into webapp 2021-03-30 17:53:31 -07:00
Ben Kraft be8952f11a embed png because fonts 2021-03-30 13:23:16 -07:00
Ben Kraft cf1965160b logo of sorts 2021-03-30 12:59:39 -07:00
Ben Kraft 315617261d silliness 2021-03-30 12:48:35 -07:00
Ben Kraft 470222e118 check some boxes off the README 2021-03-30 12:46:03 -07:00
Ben Kraft cbebeaaed4 rename in code 2021-03-30 12:41:37 -07:00
Ben KraftandGitHub db3ee65854 Rename and do some fun heading nonsense in the README 2021-03-30 12:39:59 -07:00
Ben Kraft f136758db4 misc bits of documentation 2021-03-25 14:13:14 -07:00
Ben Kraft dd85597577 more wiring for configurable context/client, theoretically should be good enough for khan use 2021-03-22 19:17:06 -07:00
Ben Kraft 17a95fd4de more TODOs, and especially clarify the situation for input type names 2021-03-22 18:45:52 -07:00
Ben Kraft a42c9b8166 clean up various TODOs and comments 2021-03-22 18:11:51 -07:00
Ben Kraft 463e3ed319 remove pointers for optionality -- shockingly easy 2021-03-22 17:39:22 -07:00
Ben Kraft fed38e4f55 redo type naming 2021-03-19 18:40:58 -07:00
Ben Kraft 58f4aff83b more design updates -- clarify what's decided and decide some things 2021-03-19 17:22:23 -07:00
Ben Kraft 5accc088c5 more docs about design and what remains to be done 2021-03-16 19:01:45 -07:00
Ben KraftandGitHub 8d46de3a9b Bit more detail on what we need to use non-fragment queries in prod 2021-03-16 12:42:43 -07:00
Ben KraftandGitHub f3282426f2 TODOs 2020-09-04 17:14:40 -07:00
Ben Kraft cf7136ca65 total rewrite to interface handling; not complete but it compiles 2020-07-16 13:28:43 -07:00
Ben Kraft af4a765a32 back out interfaces/unions, in preparation for new approach 2020-07-16 09:53:21 -07:00
Ben Kraft d2d5c9469d notes on approaches to the interface/fragment problem 2020-07-15 17:36:24 -07:00
Ben Kraft 6f0e5fdf0d unions are easy too, sorta 2020-07-15 17:35:47 -07:00
Ben Kraft d089ab1afb test, and clean up, support for __typename 2020-07-15 17:35:47 -07:00
Ben Kraft cf6f57f5f1 interfaces themselves are actually trivial! 2020-07-15 17:35:47 -07:00
Ben KraftandGitHub 3b80f09c79 reword TODO 2020-07-10 13:59:35 -07:00
Ben KraftandGitHub 5da8b3203b more TODO from mark 2020-07-10 13:48:09 -07:00
Ben Kraft 5042a9a549 allow omitting context 2020-05-01 18:45:39 -07:00
Ben Kraft 7ab06dfd30 add support for enums 2020-04-10 18:16:32 -07:00
Ben Kraft c536227d32 make config file optional 2020-03-27 16:37:48 -07:00
Ben Kraft 6caa3fc6c4 Give up on running example in GitHub Actions for now 2020-03-27 16:27:08 -07:00