ardatan / ardatan/graphql-import

Use in conjunction with graphql-tools?

Open
#97 0 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
No language data
Stars
864
Forks
53
PR merge metrics
No merged PRs in 30d

Description

[`graphql-relay-tools`](https://github.com/excitement-engineer/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`](https://github.com/apollographql/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,

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

… would result in the following GraphQL type:
```graphql
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?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing how graphql-import handles static .graphql files and whether its entry points support the interpolation used by graphql-tools and graphql-relay-tools. No repository file or test is named; done would require a decided approach for supporting this pattern, along with corresponding implementation and verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.