Skip to content
/ straf Public
forked from ThundR67/straf

Convert Golang Struct To GraphQL Object On The Fly

License

Notifications You must be signed in to change notification settings

mcmakler/straf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card

Straf

Convert Golang Struct To GraphQL Object On The Fly

Example

type UserExtra struct {
    Age int
    Gender string
}

type User struct {
    UserID int
    Username string
    Extra UserExtra
}


func main() {
    //GetGraphQLObject will convert golang struct to a graphQL object
    userType, err := straf.GetGraphQLObject(User{})

    //You can then use userType in your graphQL schema
}

About

Convert Golang Struct To GraphQL Object On The Fly

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%