Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Query merging does not work correctly. #61

Open
@urkle

Description

I have the following setup

export const graph = graphql('/graphql', {
 method: 'POST',
 asJSON: true,
 debug: true,
});
graph.fragment({
 video: `on Video {
 id
 description
 duration
 videoType
 }`,
 category: `on Category {
 id
 name
 categoryType
 }`,
});
export const videos = graph.query('{ videos { ...video } }');
export const categories = graph.query('{ categories { ...category } }');

I try to use the "merge" functionality like so.

queries.videos.merge('test');
queries.categories.merge('test');
queries.graph.commit('test').then((r) => console.log('all', r));

Now the query sent to my server is as follows.

query {
merge993382_videos :{ videos { ... video } }
merge278951_categories :{ categories { ... category } }
 }
fragment video on Video {
 id
 description
 duration
 videoType
 }
fragment category on Category {
 id
 name
 categoryType
 }

Which is, of course, invalid as the extra {} shouldn't be there around the query pieces.

I'm using graphql.js version 0.6.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /