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

Use in conjunction with graphql-tools? #97

Open
grahamb opened this issue Feb 28, 2018 · 0 comments
Open

Use in conjunction with graphql-tools? #97

grahamb opened this issue Feb 28, 2018 · 0 comments
Labels

Comments

@grahamb
Copy link

grahamb commented Feb 28, 2018

graphql-relay-tools is a "library that allows the easy creation of Relay compliant servers using the GraphQL type language", used in conjunction with graphql-tools. It provides helper functions for dealing with Relay connections, object identification, etc.

graphql-relay-tools & graphql-tools both assume that you're defining your types, etc using JavaScript templated strings, and uses interpolation to call its functions. For example,

const factionType = `
type Faction {
  ships${connectionArgs()}: ShipConnection
} 
`;

… would result in the following GraphQL type:

type Faction {
  ships(
    first: Int,
    after: String,
    last: Int,
    before: String
  )
}: ShipConnection

Right now, I can't see a way to use this pattern with static .graphql files and graphql-import. Am I missing something? If not, is this something that would be considered as an addition to the library?

@grahamb grahamb changed the title Use in conjunction with graphql-tools Use in conjunction with graphql-tools? Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants