timqian/gql-generator được TopGit xếp vào nhóm dự án mã nguồn mở, với 388 sao trên GitHub, viết chủ yếu bằng JavaScript. Generate queries from graphql schema, used for writing api test.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
# Install
npm install gql-generator -g
# see the usage
gqlg --help
# Generate sample queries from schema file
gqlg --schemaFilePath ./example/sampleTypeDef.graphql --destDirPath ./example/output --depthLimit 5
Now the queries generated from the sampleTypeDef.graphql can be found in the destDir: ./example/output.
This tool generate 3 folders holding the queries: mutations, queries and subscriptions. And also index.js files to export the queries in each folder.
You can require the queries like this:
// require all the queries
const queries = require('./example/output');
// require mutations only
const mutations = require('./example/output/mutations');
// sample content
console.log(queries.mutations.signup);
console.log(mutations.signup);
/*
mutation signup($username: String!, email: String!, password: String!){
signup(username: $username, email: $email, password: $password){
token
user {
id
username
email
createdAt
}
}
}
*/
The tool will automatically exclude any @deprecated schema fields (see more on schema directives here). To change this behavior to include deprecated fields you can use the includeDeprecatedFields flag when running the tool, e.g. gqlg --includeDeprecatedFields.
Programmatic Access
Alternatively, you can run gql-generator directly from your scripts:
As this tool is used for tests, it expands all of the fields in a query. There might be recursive fields in the query, so gqlg ignores the types which have been added in the parent queries already by default. This can be disabled using the --includeCrossReferences argument.
Variable names are derived from argument names, so variables generated from multiple occurrences of the same argument name must be deduped. An index is appended to any duplicates e.g. region(language: $language1).
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/timqian/gql-generator là nguồn chính thức.
timqian/gql-generator có bao nhiêu sao?
timqian/gql-generator có 388 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/timqian/gql-generator. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
timqian/gql-generator có phải mã nguồn mở không?
Có — timqian/gql-generator phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/timqian/gql-generator.
timqian/gql-generator còn đang phát triển không?
Commit gần nhất trên timqian/gql-generator là 9 tháng trước (theo timestamp GitHub). Repo có 93 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
timqian/gql-generator là gì?
timqian/gql-generator (timqian/gql-generator) là dự án JavaScript trên GitHub. Theo mô tả gốc: Generate queries from graphql schema, used for writing api test.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về gql-generator?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về gql-generator.