Apollo server v3 playground offline - apollo

I migrated from Apollo server v2 to v3 and I had trouble loading a Graphql playground override for offline usage.
The previous syntax was by filling the "playground" property in the Apollo server constructor but now this property doesn't exist.

So after looking for the new way to load my offline playground I found that there is a plugin called ApolloServerPluginLandingPageGraphQLPlayground in the apollo-server-core package.
This package behaves expects the same params as the old syntax and it worked for me.
Hope it will be helpful for someone.

Related

AWS JAVA SDK V2 - how to work with metadata service

till now i am working with V1 of the SDK, how ever I need to support IMDSV2. although in the V1 code I see it support it, actually it isnt, as I still getting 401 and it seems that I need to query the token and pass it to the metadata utils. I wanted to see if in V2 it was fixed, but i dont see in their doc, how to interact with the metadata service
spring cloud 1.12 resolved the issue for me. This version supports IMDSv2 and not the older ones.

Ionic2, Microsoft package, & Azure ADAL failed Authentication

I am posting after extensive research about the subject and hope to get an answer.
I am using ADAL for Azure authentication following the Ionic2 guide: https://ionicframework.com/docs/native/ms-adal/
In it, they define the AuthenticationContext as follows:
let authContext: AuthenticationContext = this.msAdal.createAuthenticationContext('https://login.windows.net/common');
When I run the app in the browser, immediately i get a "validation failed: undefined" error message.
Other guides define the variable as follows:
var authContext = new Microsoft.ADAL.AuthenticationContext('https://login.windows.net/common');
I couldn't import Microsoft package, so I followed the solution for this question: 3rd Party Library “cordova-plugin-ms-azure-mobile-apps” not getting recognized in my Ionic 2 app
However, now i get the error: cannot read property 'ADAL' of undefined
Any help is appreciated. Thanks in advance.
The MS AL a cordova plugin, it doesn't provider the version for running in the browser. It is required to run under the cordova environment(Android, iOS, Windows platform) instead of browser.

Basic Ember app not working with default adapter

Here is the source code.
I'm running Ember-CLI from the master branch of the git repo (currently version 2.2.0-beta.1-master-e803ac7fa6) and linking via npm. This should be using versions 2.2.0 of Ember and Ember Data. In the middle of the basic tutorial, I hit an issue with Mirage and Ember Data. Without explicitly creating an application adapter, the app fails. There is a 404 error being thrown on the route that should be handled by Mirage, as well as numerous Adapter errors. No errors are shown during ember serve.
In trying to fix this, I ran into another issue. After running ember g adapter application, the app loaded in the browser but there was still an error because this generated a RESTAdapter instead of the preferred JSONAPIAdapter. After manually switching to the JSONAPIAdapter, everything is fine.
Is this an issue with Ember-CLI still using an old version of Ember Data somehow? Update: #Michael and #Gaurav found the issue with Ember-CLI. See his answer for the Github issue link.
The original question still stands, though. Should Ember be able to function without explicitly creating an adapter?
This is a bug with Ember CLI 2.2.0-beta.1 - it's using the wrong adapter type by default. Can you open an issue on Ember CLI? Thanks!

What should I use instead of DS.FixtureAdapter

You gotta love ember.js team... I'm getting this depreciation message saying that: "DS.FixtureAdapter has been deprecated and moved into an unsupported addon: https://github.com/emberjs/ember-data-fixture-adapter/tree/master". Guys maintaining that addon advise that we should use a library similar to Pretender. Has anybody done that? Is there a tutorial showing how to integrate this lib so that everything would work as before?
If you are using ember-cli it comes with an http-mock out of the box letting you quickly setup fixtures in a more realistic test scenario. For instance, for a Conversation model you would mock it by running the following prompt on your command line.
ember g http-mock conversations
This will scaffold an endpoint located at server/mocks/conversations.js that your real adapters will use to get data when you run ember serve. You can modify this file to your liking to return whatever fixtures / mock data you want for the various CRUD operations you need.
Server mocks:
Ember CLI's http-mock
Clientside mocks:
Pretender.js
jQuery mockjax
Ember CLI Mirage, basically sugar around Pretender
Clientside mocking has some advantages like portability, making it easy to use in a CI environment, but server mocks let you take advantage of express middleware.
Note: I maintain Mirage. You can watch a screencast & overview here.
I like to use http-mocks with ember-cli. In addition I like to use raw JSON files as the payloads for each endpoint here is an example setup https://github.com/pixelhandler/ember-fixturific/pull/1/files

How to get ember.js module work in play framework

I developed a little web app and now I'm trying ti merge the server-side code deployed under Play! framework with my client-side code made with Ember.js.
I found this module https://github.com/krumpi/play-emberjs
on Play! web site but I can't get it to work, it gives me this error
sbt.ResolveException: unresolved dependency: com.ketalo.play.plugins#emberjs;0.4.0-SNAPSHOT: not found
Does anybody know how to fix it?
Thanks.
If you are using ember rc6 than you need to define the right snapshot.
As stated in the docs:
version 0.4.0-SNAPSHOT Include support for ember.js 1.0 rc6
for ember rc6 you will need snapshot 0.4.0. But the error you get is suggesting that you are using snapshot 0.1.0
Hope it helps.
There is a mistake in the samples
The plugins.sbt needs to include a reference to the sonatatype repository:
// Repository for sonata snapshots
resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"