-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: fixed workflow for generating introspection query for docs (#578)
* feat: .sh to generate a temp.schema to generate introspection.json * ci: rename file to avoid collisions * ci: move schema-introspection for query examples * fix: fix some comments in generate-intros-partial script * Update .gitignore Co-authored-by: Rekard0 <[email protected]> * Update .github/workflows/subgraph-documentation-update.yml Co-authored-by: Michael Heuer <[email protected]> * chore: move scripts inside /cripts |- /docs and /tests folders --------- Co-authored-by: Rekard0 <[email protected]> Co-authored-by: Michael Heuer <[email protected]>
- Loading branch information
1 parent
e79b857
commit c92d129
Showing
8 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,4 @@ schema-introspection.json | |
|
||
# docs | ||
packages/subgraph/docs/developer-portal/ | ||
schema-introspection-partial.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
generates: | ||
./docs/schema-introspection.json: | ||
schema: ./schema.graphql | ||
./docs/schema-introspection-partial.json: | ||
schema: ./schema.tmp.graphql | ||
plugins: | ||
- introspection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/subgraph/scripts/docs/generate-introspection-partial-json.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Copy schema.graphql to a temporary file | ||
cp schema.graphql schema.tmp.graphql | ||
|
||
# Add lines at the end of the file | ||
cat <<EOF >> schema.tmp.graphql | ||
" Byte array, represented as a hexadecimal string. Commonly used for Ethereum hashes and addresses. " | ||
scalar Bytes | ||
" Large integers. Used for Ethereum's uint32, int64, uint64, ..., uint256 types. Note: Everything below uint32, such as int32, uint24 or int8 is represented as i32. " | ||
scalar BigInt | ||
" Query type, required to generate introspection query. " | ||
type Query @entity { | ||
id: ID! | ||
} | ||
EOF | ||
|
||
# Run graphql-codegen | ||
graphql-codegen | ||
|
||
# Navigate to the docs directory | ||
cd docs || exit | ||
|
||
# Run prettier on schema-introspection-partial.json | ||
prettier schema-introspection-partial.json --write | ||
|
||
# Remove the temporary file | ||
cd .. | ||
rm schema.tmp.graphql |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters