GraphQlClientGenerator icon indicating copy to clipboard operation
GraphQlClientGenerator copied to clipboard

[Feature Request] generate queries from schema

Open borreda opened this issue 3 years ago • 2 comments

generate queries from graphql schema

for example from the file:

type Mutation { # Create a tweet for a user # consumer keys and tokens are not required for dynamo integration createTweet( tweet: String!, consumer_key: String, consumer_secret: String, access_token_key: String, access_token_secret: String, created_at: String! ): Tweet!

# Delete User Tweet
deleteTweet(
    tweet_id: String!,
    consumer_key: String,
    consumer_secret: String,
    access_token_key: String,
    access_token_secret: String
): Tweet!

# Retweet existing Tweet
reTweet(
    tweet_id: String!,
    consumer_key: String,
    consumer_secret: String,
    access_token_key: String,
    access_token_secret: String
): Tweet!

# Update existing Tweet
updateTweet(tweet_id: String!, tweet: String!): Tweet!

# Create user info is available in dynamo integration
updateUserInfo(
	location: String!,
	description: String!,
	name: String!,
	followers_count: Int!,
	friends_count: Int!,
	favourites_count: Int!,
	following: [String!]!
): User!

}

type Query { meInfo(consumer_key: String, consumer_secret: String): User! getUserInfo(handle: String!, consumer_key: String, consumer_secret: String): User!

# search functionality is available in elasticsearch integration
searchAllTweetsByKeyword(keyword: String!): TweetConnection

}

type Subscription { addTweet: Tweet @aws_subscribe(mutations: ["createTweet"]) }

type Tweet { tweet_id: String! tweet: String! retweeted: Boolean retweet_count: Int favorited: Boolean created_at: String! }

type TweetConnection { items: [Tweet!]! nextToken: String }

type User { name: String! handle: String! location: String! description: String! followers_count: Int! friends_count: Int! favourites_count: Int! following: [String!]! topTweet: Tweet tweets(limit: Int!, nextToken: String): TweetConnection

# search functionality is available in elasticsearch integration
searchTweetsByKeyword(keyword: String!): TweetConnection

}

schema { query: Query mutation: Mutation subscription: Subscription }

borreda avatar Jun 11 '22 17:06 borreda

Schema will be used to spin up a GraphQl service, or? Which will provide its full metadata in the JSON format used by the generator. So I find another (and incomplete) schema description redundant.

Husqvik avatar Jun 11 '22 19:06 Husqvik

@Husqvik my suggestion is to combine your solution with the solution below which will allow a full solution for graphql c# implementation

https://github.com/lanwin/graphql-dotnet-generator

borreda avatar Jun 12 '22 22:06 borreda

duplicate https://github.com/Husqvik/GraphQlClientGenerator/issues/118

Husqvik avatar Mar 31 '24 11:03 Husqvik