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

feat: Generator Configuration #2004

Open
tusharmath opened this issue May 22, 2024 · 1 comment · May be fixed by #2081
Open

feat: Generator Configuration #2004

tusharmath opened this issue May 22, 2024 · 1 comment · May be fixed by #2081
Assignees

Comments

@tusharmath
Copy link
Contributor

tusharmath commented May 22, 2024

This feature essentially allows developers to create GraphQL configurations automatically. This is done by providing a few inputs to the "ConfigGenerator" and then a new Configuration is automatically generated.

Technical Requirements

  1. Here is sample CLI integration of this feature:

    tailcall generate ./generator.json
  2. Proposed Configuration Input

    enum Operation {
        Query,
        Mutation
    }
    
    struct Input {
        source: Source,
        field_name: String,
        operation: Option<Operation>,    
    }
    
    enum Source {
        URL {
            url: String, 
            headers: Option<BTreeMap<String, String>>,        
            method: Option<Method>, 
            body: Option<serde_json::Value>
        },
        Proto {path: String},
        Config {url: String}
    }
    
    enum Transformer {
        TypeMerger {threshold: Option<f32>},
        AmbiguousType {
            input: Option<Name>,
            output: Option<Name>
        },
        ConsolidateBaseURL {threshold: Option<f32>},
        BetterTypeName,
        TreeShake
    }
    
    struct Name {
        prefix: Option<String>,
        postfix: Option<String>
    }
    
    struct Config {
        inputs: Vec<Input>,
        transformers: Vec<Transformer>,
        output: Output,
        schema: {
            query: Option<String>,
            mutation: Option<String>
        } 
    }
    
    struct Output {
        path: String,
        format: Option<Format>
    }
    
    enum Format {
        GraphQL,
        JSON,
        YAML
    }
@varshith257
Copy link
Contributor

varshith257 commented May 22, 2024

Can we get more info on this issue discription?🙄

@meskill meskill self-assigned this May 30, 2024
@tusharmath tusharmath changed the title [draft] feat: generalized configuration generator feat: Generator Configuration Jun 17, 2024
@tusharmath tusharmath linked a pull request Jun 17, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants