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

Tighter integration with persisted queries and GraphQL Codegen #414

Merged
merged 35 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
68b76b6
Create helper to install dependencies for a test
jerelmiller Feb 22, 2024
04e5067
Add graphql-codegen client preset as dev dependency
jerelmiller Feb 22, 2024
0556d36
Add failing test for integration with graphql codegen
jerelmiller Feb 22, 2024
71477af
Ensure function can be resolved in test
jerelmiller Feb 22, 2024
3e69d0a
Minor formatting update
jerelmiller Feb 22, 2024
484bfb2
Stub out check for custom documents source
jerelmiller Feb 22, 2024
9459d55
Add missing __typename in assertion
jerelmiller Feb 22, 2024
73dc7f3
Add implementation for parsing gql codegen manifest
jerelmiller Feb 22, 2024
b8b1182
Pull sources from gql codegen or filepath list
jerelmiller Feb 22, 2024
a38e8a6
Fix output assertion and enable all tests
jerelmiller Feb 22, 2024
bb50f9e
Add changeset
jerelmiller Feb 22, 2024
23c2988
Increase timeout on test that installs deps
jerelmiller Feb 22, 2024
0aa5eeb
Install `@graphql-codegen/cli` as dev dep
jerelmiller Feb 22, 2024
8f18b13
Use programatic API for GraphQL codegen
jerelmiller Feb 22, 2024
42d9bd4
Simplify installDependencies helper
jerelmiller Feb 22, 2024
ff5f256
Remove custom timeout on test
jerelmiller Feb 22, 2024
091b3a0
Rename symbol for clarity
jerelmiller Feb 22, 2024
3b03164
Add test to ensure persisted documents file exists
jerelmiller Feb 22, 2024
bd1fb16
Read from filepath directly before parsing
jerelmiller Feb 22, 2024
1c7be06
Check for array in parseable config
jerelmiller Feb 22, 2024
5d1adc7
Move error messages to ERROR_MESSAGES. Update erro for malformed json
jerelmiller Feb 22, 2024
ece65b4
Add test to check malformed manifest
jerelmiller Feb 22, 2024
8e95e77
Handle when manifest is not json serialized
jerelmiller Feb 22, 2024
20a4e9f
Add docblock for fromGraphQLCodegenPersistedDocuments
jerelmiller Feb 22, 2024
d772230
Update README with new capability
jerelmiller Feb 22, 2024
c795f3e
Update type of `documents` to allow for custom document source config
jerelmiller Feb 22, 2024
cc8e607
Add comment about not running validation
jerelmiller Feb 22, 2024
de894dc
Move validation of entries to document sourcer
jerelmiller Feb 22, 2024
ce8dad5
Fix test assertion on JSON parse failure
jerelmiller Feb 22, 2024
f400546
Fix formatting in README
jerelmiller Feb 22, 2024
756dda7
Mark getFilepaths and generatePersistedQueryManifest as internal func…
jerelmiller Feb 22, 2024
effeb5a
Ensure --list-files works with persisted documents
jerelmiller Feb 22, 2024
b16fcf2
Update changes to explain benefits a bit more clearly
jerelmiller Feb 22, 2024
8243f09
Only use the fragment registry if the document source should use it
jerelmiller Feb 22, 2024
3ef87a5
Fix typo in README
jerelmiller Feb 23, 2024
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
16 changes: 16 additions & 0 deletions .changeset/beige-pans-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@apollo/generate-persisted-query-manifest": minor
---

Add ability to parse documents generated by GraphQL Codegen's [persisted documents](https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#persisted-documents) feature.

```ts
// persisted-query-manifest.config.ts
import { fromGraphQLCodegenPersistedDocuments } from '@apollo/generate-persisted-query-manifest';

const config = {
documents: fromGraphQLCodegenPersistedDocuments('./path/to/persisted-documents.json')
};

export default config;
```
Loading