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

[Feature Request] generate queries from schema #105

Closed
borreda opened this issue Jun 11, 2022 · 3 comments
Closed

[Feature Request] generate queries from schema #105

borreda opened this issue Jun 11, 2022 · 3 comments

Comments

@borreda
Copy link

borreda commented Jun 11, 2022

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
}

@Husqvik
Copy link
Owner

Husqvik commented Jun 11, 2022

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.

@borreda
Copy link
Author

borreda commented Jun 12, 2022

@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

@Husqvik
Copy link
Owner

Husqvik commented Mar 31, 2024

duplicate #118

@Husqvik Husqvik closed this as completed Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants