Skip to content

annibuliful-lab/merge-graphql-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL Schema Merger

This Go package provides tools for reading, parsing, and merging GraphQL schema files from a specified directory into a single file. It is designed to support developers in combining multiple GraphQL schema files effortlessly, facilitating easier management and integration of complex GraphQL schemas.

Getting the Package

To install this package, execute the following command in your terminal:

go get github.com/annibuliful-lab/merge-graphql-schema

Example: Merging Schemas

Here's a simple example demonstrating how to use this package to merge all GraphQL schema files in a specified directory:

package main

import (
    "log"
    merger "github.com/annibuliful-lab/merge-graphql-schema"

)

func main() {
    rootDir := "./path/to/schemas"
    pattern := ".graphql"
    outputFile := "merged_schema.graphql"

    // Merge all schema files matching the pattern
    if _, err := merger.MergeSchemas(rootDir, pattern, outputFile); err != nil {
        log.Fatalf("Failed to merge schemas: %v", err)
    }

    log.Printf("Schemas successfully merged into '%s'", outputFile)

}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages