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

VSCode Plugin: Support for embedded string in PHP file #1155

Closed
swashata opened this issue Mar 30, 2019 · 1 comment
Closed

VSCode Plugin: Support for embedded string in PHP file #1155

swashata opened this issue Mar 30, 2019 · 1 comment

Comments

@swashata
Copy link

Hello,

Firstly thank you very much for this awesome extension. It works beautifully and saves a lot of time on client-side developments.

I do have a feature request. Before I come to that, here's a little about the backstory.

I develop WordPress plugins and currently in the process of developing a plugin where it will provide a graphql server. For that I am using graphql-php which can create a Apollo compliant server written in PHP.

Now using the PHP server and apollo.config.js

module.exports = {
	client: {
		service: {
			name: 'something.test',
			url: 'http://something.test/my-plug/graphql',
		},
	},
};

I can point apollo client to my GraphQL endpoint URL and it works fine in JavaScript/TypeScript files. I mean I am very thankful and just blown away that this extension can talk to my in-development graphql-server (not written with apollo-server, but graphql-php) and provide intellisense within my typescript files.

awesome-apollo

This is just awesome.

But for testing out the server, I do write integration tests in PHP where I do something like

$mutation = <<<'GQL'
mutation CreateCategory($title: String!, $description: String!) {
	createCategory(data: {
		title: $title
		description: $description
	}) {
		id
		title
		description
	}
}
GQL;
for ( $i = 0; $i < 10; $i++ ) {
	self::executeGraphQLQuery(
		$mutation,
		[
			'title' => 'Category ' . $i,
			'description' => 'This category is created in ' . $i . ' iteration',
		]
	);
}

Now life would've been complete, if the string inside the PHP newdoc, i.e, the string after $mutation = <<<'GQL' and before GQL;

  1. Syntax highlighted.
  2. Optionally provide that same awesome language server feature.

Thank you very much for your consideration. I am a regular user of this plugin and if by any means I can help, please point me in the direction.

@trevor-scheer
Copy link
Member

Hey @swashata, thanks for the great writeup. At this time, support for PHP is not something we'd be building ourselves, but we would definitely consider a PR for it!

I'll point to a previous PR that we merged recently that adds support for Ruby. If you're interested in implementing this, it would be much appreciated!

#1304

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

No branches or pull requests

2 participants