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

Recommend an extension to use #203

Closed
gajus opened this issue Aug 22, 2016 · 10 comments
Closed

Recommend an extension to use #203

gajus opened this issue Aug 22, 2016 · 10 comments

Comments

@gajus
Copy link

gajus commented Aug 22, 2016

There is no official recommendation for what file extension to use to store GraphQL schemas/ queries. I am assuming it would be either .graphql or .gql.

Making an official recommendation would increase consistency across all projects.

@gajus
Copy link
Author

gajus commented Aug 22, 2016

Based on this conversation:

File extension is recommended to be .graphql - .js should never be treated as GraphQL.

github-linguist/linguist#2637

I am assuming it is .graphql. However, I did not find this referenced in the documentation.

@iwaldman
Copy link

What would be the downside to shortening the extension to just .gql?

@gajus
Copy link
Author

gajus commented Aug 24, 2016

For one, it is used by another software http://filext.com/file-extension/GQL. Albeit, it seem to no longer be an active use.

On Aug 24, 2016, at 16:47, Irvin Waldman notifications@github.com wrote:

What would be the downside to shortening the extension to just .gql?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@alangenfeld
Copy link

We use .graphql internally at Facebook

@Vadorequest
Copy link

For the record, .graphql is natively recognised by the Intellij IDEA suite.

@indreklasn
Copy link

Is this still being developed? Most example projects and articles still use .js. Which one is the correct way?

@leebyron
Copy link
Collaborator

leebyron commented Jul 21, 2019 via email

@cbrunnkvist
Copy link

I'm confused by the apparent implicit consensus to use .graphql both for the GraphQL schema language, and seemingly also for files containing GraphQL queries? Or maybe saving (named) queries in separate files is somehow not common practice?

@sungam3r
Copy link
Contributor

These are two parts of one GraphQL language. The same situation with SQL: Data Manupulation Language (DML) and Data Definition Language (DDL) - both have .sql extension.

Enrico2 pushed a commit to apollographql/federation that referenced this issue Jun 29, 2020
Enrico2 pushed a commit to apollographql/federation that referenced this issue Jun 30, 2020
I looked into the various configuration files we currently have checked in, after reading the issue (#86) that was opened on whether or we should have any editor specific files in the repository.

I noticed we check in some files that are not used by anyone, a file that is likely only used by me (and only rarely tbh), and some that we can move to to a designated folder, to reduce some of the clutter without affecting editor functionality.

This PR brings the repo to a state where the only editor specific files are contained in `.idea`. As we discuss the issue mentioned above, we might end up removing this folder all together, but I'd like us to make that decision against this PRs version of the repository (cleaner, less cluttered, reflects one of the suggestions in the issue)

Commits:
* _Move_ all IntelliJ config files to `.idea`
* _Delete_ `cli/.graphqlconfig` -- this doesn't need to be checked in to make anyone more productive in a significant or commonly used way (i.e. this is only for IJ users with a specific plugin and can easily be created locally. I've added it to .gitignore).
* _Delete_ config files that we don't use (`.travis.yml`, `bulk.yaml`, `vagga.yaml`) that were copied over when we forked `graphql-parser`.
* _Rename_ the `github.gql` file to use the more common, seemingly agreed upon, file extension (`.graphql`, see graphql/graphql-spec#203 (comment)).
@Stalinko
Copy link

Stalinko commented Jun 2, 2023

For the record, .graphql is natively recognised by the Intellij IDEA suite.

Let me correct you. It is not natively recognised, but there is an extension for GraphQL language which enables recognition of graphql files. At least that's the case for PHPStorm which is the same platform.
That's why I finally decided to not install one more extension just to have highlighting for these files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants