graphql-import icon indicating copy to clipboard operation
graphql-import copied to clipboard

Use in conjunction with graphql-tools?

Open grahamb opened this issue 6 years ago • 0 comments

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 avatar Feb 28 '18 00:02 grahamb